Class MechanismInfo


  • public class MechanismInfo
    extends java.lang.Object
    Objects of this class provide information about a certain mechanism that a token implements.
    Author:
    Karl Scheibelhofer (SIC), Lijun Liao (xipki)
    • Constructor Summary

      Constructors 
      Constructor Description
      MechanismInfo​(long minKeySize, long maxKeySize, long flags)  
      MechanismInfo​(CK_MECHANISM_INFO ckMechanismInfo)
      Constructor taking a CK_MECHANISM_INFO object as data source.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearFlagBit​(long flagMask)
      Clear the given feature flag.
      long getMaxKeySize()
      Get the maximum key length supported by this mechanism.
      long getMinKeySize()
      Get the minimum key length supported by this mechanism.
      boolean hasFlagBit​(long flagMask)  
      void setFlagBit​(long flagMask)
      Set the given feature flag.
      boolean supports​(MechanismInfo requiredFeatures)
      Check, if this mechanism info has those flags set to true, which are set in the given mechanism info.
      java.lang.String toString()
      Returns the string representation of this object.
      java.lang.String toString​(java.lang.String indent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MechanismInfo

        public MechanismInfo​(CK_MECHANISM_INFO ckMechanismInfo)
        Constructor taking a CK_MECHANISM_INFO object as data source.
        Parameters:
        ckMechanismInfo - The CK_MECHANISM_INFO object that provides the data.
      • MechanismInfo

        public MechanismInfo​(long minKeySize,
                             long maxKeySize,
                             long flags)
        Parameters:
        minKeySize - The minimum key length supported by this mechanism.
        maxKeySize - The maximum key length supported by this mechanism.
        flags - The flag bit(s).
    • Method Detail

      • getMinKeySize

        public long getMinKeySize()
        Get the minimum key length supported by this mechanism.
        Returns:
        The minimum key length supported by this mechanism.
      • getMaxKeySize

        public long getMaxKeySize()
        Get the maximum key length supported by this mechanism.
        Returns:
        The maximum key length supported by this mechanism.
      • hasFlagBit

        public boolean hasFlagBit​(long flagMask)
      • setFlagBit

        public void setFlagBit​(long flagMask)
        Set the given feature flag.
        Parameters:
        flagMask - The mask of the flag bit(s).
      • clearFlagBit

        public void clearFlagBit​(long flagMask)
        Clear the given feature flag.
        Parameters:
        flagMask - The mask of the flag bit(s).
      • supports

        public boolean supports​(MechanismInfo requiredFeatures)
        Check, if this mechanism info has those flags set to true, which are set in the given mechanism info. This may be used as a simple check, if some operations are supported. This also checks the key length range, if they are specified in the given mechanism object; i.e. if they are not zero.
        Parameters:
        requiredFeatures - The required features.
        Returns:
        True, if the required features are supported.
      • toString

        public java.lang.String toString()
        Returns the string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of this object
      • toString

        public java.lang.String toString​(java.lang.String indent)