public class MechanismInfo
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected long |
flags_
Contains all feature flags of this mechanism info.
|
protected long |
maxKeySize_
The maximum key length supported by this algorithm.
|
protected long |
minKeySize_
The minimum key length supported by this algorithm.
|
Constructor and Description |
---|
MechanismInfo()
Default constructor.
|
MechanismInfo(CK_MECHANISM_INFO ckMechanismInfo)
Constructor taking a CK_MECHANISM_INFO object as data source.
|
Modifier and Type | Method and Description |
---|---|
MechanismInfo |
and(MechanismInfo other)
Create a new MechanismInfo objects whichs flags are a logical AND of this object's flags and
the other object's flags.
|
java.lang.Object |
clone()
Create a (deep) clone of this object.
|
boolean |
equals(java.lang.Object otherObject)
Override equals to check for the equality of mechanism infos.
|
long |
getMaxKeySize()
Get the maximum key length supported by this mechanism.
|
long |
getMinKeySize()
Get the minimum key length supported by this mechanism.
|
int |
hashCode()
Override hashCode to ensure that hashtable still works after overriding equals.
|
boolean |
isDecrypt()
Check, if this mechanism can be used for decryption.
|
boolean |
isDerive()
Check, if this mechanism can be used for key derivation.
|
boolean |
isDigest()
Check, if this mechanism can be used for digesting.
|
boolean |
isEcCompress()
Check, if this mechanism can be used with elliptic curve point compressed.
|
boolean |
isEcEcParameters()
Check, if this mechanism can be used with EC domain parameters of the choice ecParameters.
|
boolean |
isEcF2m()
Check, if this mechanism can be used with EC domain parameters over F2m.
|
boolean |
isEcFp()
Check, if this mechanism can be used with EC domain parameters over Fp.
|
boolean |
isEcNamedCurve()
Check, if this mechanism can be used with EC domain parameters of the choice namedCurve.
|
boolean |
isEcUncompress()
Check, if this mechanism can be used with elliptic curve point uncompressed.
|
boolean |
isEncrypt()
Check, if this mechanism can be used for encryption.
|
boolean |
isExtension()
Check, if there is an extension to the flags; false, if no extensions.
|
boolean |
isGenerate()
Check, if this mechanism can be used for secret key generation.
|
boolean |
isGenerateKeyPair()
Check, if this mechanism can be used for key-pair generation.
|
boolean |
isHw()
Check, if this mechanism is performed in hardware.
|
boolean |
isSign()
Check, if this mechanism can be used for signing.
|
boolean |
isSignRecover()
Check, if this mechanism can be used for signing with data recovery.
|
boolean |
isUnwrap()
Check, if this mechanism can be used for key unwrapping.
|
boolean |
isVerify()
Check, if this mechanism can be used for verification.
|
boolean |
isVerifyRecover()
Check, if this mechanism can be used for verification with data recovery.
|
boolean |
isWrap()
Check, if this mechanism can be used for key wrapping.
|
MechanismInfo |
not()
Create a new MechanismInfo objects whichs flags are a logical NOT of this object's flags.
|
MechanismInfo |
or(MechanismInfo other)
Create a new MechanismInfo objects whichs flags are a logical OR of this object's flags and the
other object's flags.
|
void |
setDecrypt(boolean decrypt)
Set if this mechanism can be used for decryption.
|
void |
setDerive(boolean derive)
Set if this mechanism can be used for key derivation.
|
void |
setDigest(boolean digest)
Set if this mechanism can be used for digesting.
|
void |
setEcCompress(boolean ecCompress)
Set if this mechanism can be used with elliptic curve point compressed.
|
void |
setEcEcParameters(boolean ecEcParameters)
Set if this mechanism can be used with EC domain parameters of the choice ecParameters.
|
void |
setEcF2m(boolean ecF2m)
Set if this mechanism can be used with EC domain parameters over F2m.
|
void |
setEcFp(boolean ecFp)
Set if this mechanism can be used with EC domain parameters over Fp.
|
void |
setEcNamedCurve(boolean ecNamedCurve)
Set if this mechanism can be used with EC domain parameters of the choice namedCurve.
|
void |
setEcUncompress(boolean ecUncompress)
Set if this mechanism can be used with elliptic curve point uncompressed.
|
void |
setEncrypt(boolean encrypt)
Set if this mechanism can be used for encryption.
|
void |
setExtension(boolean extension)
Set if there is an extension to the flags; false, if no extensions.
|
protected void |
setFlagBit(long flagMask,
boolean value)
Set the given feature flag(s) to the given value.
|
void |
setGenerate(boolean generate)
Set if this mechanism can be used for secret key generation.
|
void |
setGenerateKeyPair(boolean generateKeyPair)
Set if this mechanism can be used for key-pair generation.
|
void |
setHw(boolean hw)
Set, if this mechanism is performed in hardware.
|
void |
setMaxKeySize(long maxKeySize)
/** Set the maximum key length supported by this mechanism.
|
void |
setMinKeySize(long minKeySize)
Set the minimum key length supported by this mechanism.
|
void |
setSign(boolean sign)
Set if this mechanism can be used for signing.
|
void |
setSignRecover(boolean signRecover)
Set if this mechanism can be used for signing with data recovery.
|
void |
setUnwrap(boolean unwrap)
Set if this mechanism can be used for key unwrapping.
|
void |
setVerify(boolean verfy)
Set if this mechanism can be used for verification.
|
void |
setVerifyRecover(boolean verifyRecover)
Set if this mechanism can be used for verification with data recovery.
|
void |
setWrap(boolean wrap)
Set if this mechanism can be used for key wrapping.
|
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.
|
protected long minKeySize_
protected long maxKeySize_
protected long flags_
public MechanismInfo()
public MechanismInfo(CK_MECHANISM_INFO ckMechanismInfo)
ckMechanismInfo
- The CK_MECHANISM_INFO object that provides the data.public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
otherObject
- The other MechanismInfo object.public int hashCode()
hashCode
in class java.lang.Object
public long getMinKeySize()
public long getMaxKeySize()
public boolean isHw()
public boolean isEncrypt()
public boolean isDecrypt()
public boolean isDigest()
public boolean isSign()
public boolean isSignRecover()
public boolean isVerify()
public boolean isVerifyRecover()
public boolean isGenerate()
public boolean isGenerateKeyPair()
public boolean isWrap()
public boolean isUnwrap()
public boolean isDerive()
public boolean isEcFp()
public boolean isEcF2m()
public boolean isEcEcParameters()
public boolean isEcNamedCurve()
public boolean isEcUncompress()
public boolean isEcCompress()
public boolean isExtension()
public MechanismInfo or(MechanismInfo other)
other
- The other MechanismInfo object.public MechanismInfo and(MechanismInfo other)
other
- The other MechanismInfo object.public MechanismInfo not()
public void setMinKeySize(long minKeySize)
minKeySize
- The minimum key length supported by this mechanism.public void setMaxKeySize(long maxKeySize)
maxKeySize
- The maximum key length supported by this mechanism.public void setHw(boolean hw)
hw
- True, if this mechanism is performed in hardware.public void setEncrypt(boolean encrypt)
encrypt
- True, if this mechanism can be used for encrpytion.public void setDecrypt(boolean decrypt)
decrypt
- True, if this mechanism can be used for decrpytion.public void setDigest(boolean digest)
digest
- True, if this mechanism can be used for digesting.public void setSign(boolean sign)
sign
- True, if this mechanism can be used for signing.public void setSignRecover(boolean signRecover)
signRecover
- True, if this mechanism can be used for signing with data recovery.public void setVerify(boolean verfy)
verfy
- True, if this mechanism can be used for verification.public void setVerifyRecover(boolean verifyRecover)
verifyRecover
- True, if this mechanism can be used for verification with data recovery.public void setGenerate(boolean generate)
generate
- True, if this mechanism can be used for secret key generation.public void setGenerateKeyPair(boolean generateKeyPair)
generateKeyPair
- True, if this mechanism can be used for key-pair generation.public void setWrap(boolean wrap)
wrap
- True, if this mechanism can be used for key wrapping.public void setUnwrap(boolean unwrap)
unwrap
- True, if this mechanism can be used for key unwrapping.public void setDerive(boolean derive)
derive
- True, if this mechanism can be used for key derivation.public void setEcFp(boolean ecFp)
ecFp
- True, if this mechanism can be used with EC domain parameters over Fp.public void setEcF2m(boolean ecF2m)
ecF2m
- True, if this mechanism can be used with EC domain parameters over F2m.public void setEcEcParameters(boolean ecEcParameters)
ecEcParameters
- True, if this mechanism can be used with EC domain parameters of the choice
ecParameters.public void setEcNamedCurve(boolean ecNamedCurve)
ecNamedCurve
- True, if this mechanism can be used with EC domain parameters of the choice
namedCurve.public void setEcUncompress(boolean ecUncompress)
ecUncompress
- True, if this mechanism can be used with elliptic curve point uncompressed.public void setEcCompress(boolean ecCompress)
ecCompress
- True, if this mechanism can be used with elliptic curve point compressed.public void setExtension(boolean extension)
extension
- False for this version.public boolean supports(MechanismInfo requiredFeatures)
requiredFeatures
- The required features.public java.lang.String toString()
toString
in class java.lang.Object
protected void setFlagBit(long flagMask, boolean value)
flagMask
- The mask of the flag bit(s).value
- True to set the flag(s), false to clear the flag(s).IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. version 1.6.9