Modifier and Type | Field and Description |
---|---|
private static final boolean | |
private static final Hashtable | |
private boolean | |
private static final byte[] | |
private MessageDigest | |
private RSAPrivateKey | |
private RSAPublicKey | |
private SecureRandom | |
private PSSParameterSpec |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
private static void | checkKeyLength(RSAKey key, int digestLen, int saltLen)
Utility method for checking key length against digest length and salt length |
private boolean | decodeSignature(byte[] mHash, byte[] em)
Decode the signature data as under RFC8017 sec9.1.2 EMSA-PSS-VERIFY |
private byte[] | |
protected Object | engineGetParameter(String
the string name of the parameter. param)Implements abstract java.
Deprecated
Gets the value of the specified algorithm parameter.
|
protected AlgorithmParameters | engineGetParameters()
Overrides java. Signature object.
|
protected void | engineInitSign(PrivateKey
the private key of the identity whose signature
will be generated. privateKey)Implements abstract java. Signature object with the specified
private key for signing operations.
|
protected void | engineInitSign(PrivateKey
the private key of the identity whose signature
will be generated. privateKey, SecureRandom the source of randomness random)Overrides java. Signature object with the specified
private key and source of randomness for signing operations.
|
protected void | engineInitVerify(PublicKey
the public key of the identity whose signature is
going to be verified. publicKey)Implements abstract java. Signature object with the specified
public key for verification operations.
|
protected void | engineSetParameter(String
the string identifier of the parameter. param, Object the parameter value. value)Implements abstract java.
Deprecated
Sets the specified algorithm parameter to the specified
value.
|
protected void | engineSetParameter(AlgorithmParameterSpec
the parameters params)Overrides java. Signature object with the specified parameter
values.
|
protected byte[] | engineSign()
Implements abstract java. |
protected void | engineUpdate(byte
the byte to use for the update. b)Implements abstract java. |
protected void | engineUpdate(byte[]
the array of bytes b, int the offset to start from in the array of bytes off, int the number of bytes to use, starting at offset len)Implements abstract java. |
protected void | engineUpdate(ByteBuffer
the ByteBuffer b)Overrides java. |
protected boolean | engineVerify(byte[]
the signature bytes to be verified. sigBytes)Implements abstract java. |
private void | |
private byte[] | |
private static int | |
private static boolean | isCompatible(AlgorithmParameterSpec keyParams, PSSParameterSpec sigParams)
Utility method for checking the key PSS parameters against signature PSS parameters. |
private boolean | |
private void | |
private void | |
private void | |
private void | |
private PSSParameterSpec |
DEBUG | back to summary |
---|---|
private static final boolean DEBUG |
DIGEST_LENGTHS | back to summary |
---|---|
private static final Hashtable<KnownOIDs, Integer> DIGEST_LENGTHS |
digestReset | back to summary |
---|---|
private boolean digestReset |
EIGHT_BYTES_OF_ZEROS | back to summary |
---|---|
private static final byte[] EIGHT_BYTES_OF_ZEROS |
md | back to summary |
---|---|
private MessageDigest md |
privKey | back to summary |
---|---|
private RSAPrivateKey privKey |
pubKey | back to summary |
---|---|
private RSAPublicKey pubKey |
random | back to summary |
---|---|
private SecureRandom random |
sigParams | back to summary |
---|---|
private PSSParameterSpec sigParams |
RSAPSSSignature | back to summary |
---|---|
public RSAPSSSignature() Construct a new RSAPSSSignature with arbitrary digest algorithm |
checkKeyLength | back to summary |
---|---|
private static void checkKeyLength(RSAKey key, int digestLen, int saltLen) throws InvalidKeyException Utility method for checking key length against digest length and salt length |
decodeSignature | back to summary |
---|---|
private boolean decodeSignature(byte[] mHash, byte[] em) throws IOException Decode the signature data as under RFC8017 sec9.1.2 EMSA-PSS-VERIFY |
encodeSignature | back to summary |
---|---|
private byte[] encodeSignature(byte[] mHash) throws IOException, DigestException Encode the digest 'mHash', return the to-be-signed data. Also used by the PKCS#11 provider. |
engineGetParameter | back to summary |
---|---|
protected Object engineGetParameter(String param) throws InvalidParameterException Implements abstract java. Doc from java. Deprecated
Gets the value of the specified algorithm parameter. This method supplies a general-purpose mechanism through which it is possible to get the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.
|
engineGetParameters | back to summary |
---|---|
protected AlgorithmParameters engineGetParameters() Overrides java. Doc from java. Returns the parameters used with this The returned parameters may be the same that were used to initialize
this However, if the signature scheme does not support returning
the parameters as
|
engineInitSign | back to summary |
---|---|
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException Implements abstract java. Doc from java. Initializes this
|
engineInitSign | back to summary |
---|---|
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException Overrides java. Doc from java. Initializes this This concrete method has been added to this previously-defined abstract class. (For backwards compatibility, it cannot be abstract.)
|
engineInitVerify | back to summary |
---|---|
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException Implements abstract java. Doc from java. Initializes this
|
engineSetParameter | back to summary |
---|---|
protected void engineSetParameter(String param, Object value) throws InvalidParameterException Implements abstract java. Doc from java. Deprecated
Sets the specified algorithm parameter to the specified value. This method supplies a general-purpose mechanism through which it is possible to set the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.
|
engineSetParameter | back to summary |
---|---|
protected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException Overrides java. Doc from java. Initializes this
|
engineSign | back to summary |
---|---|
protected byte[] engineSign() throws SignatureException Implements abstract java. Doc from java. Returns the signature bytes of all the data updated so far. The format of the signature depends on the underlying signature scheme.
|
engineUpdate | back to summary |
---|---|
protected void engineUpdate(byte b) throws SignatureException Implements abstract java. Doc from java. Updates the data to be signed or verified using the specified byte.
|
engineUpdate | back to summary |
---|---|
protected void engineUpdate(byte[] b, int off, int len) throws SignatureException Implements abstract java. Doc from java. Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
|
engineUpdate | back to summary |
---|---|
protected void engineUpdate(ByteBuffer b) Overrides java. Doc from java. Updates the data to be signed or verified using the specified
ByteBuffer. Processes the
|
engineVerify | back to summary |
---|---|
protected boolean engineVerify(byte[] sigBytes) throws SignatureException Implements abstract java. Doc from java. Verifies the passed-in signature.
|
ensureInit | back to summary |
---|---|
private void ensureInit() throws SignatureException Ensure the object is initialized with key and parameters and reset digest |
getDigestValue | back to summary |
---|---|
private byte[] getDigestValue() Return the message digest value. |
getKeyLengthInBits | back to summary |
---|---|
private static int getKeyLengthInBits(RSAKey k) |
isCompatible | back to summary |
---|---|
private static boolean isCompatible(AlgorithmParameterSpec keyParams, PSSParameterSpec sigParams) Utility method for checking the key PSS parameters against signature PSS parameters. Returns false if any of the digest/MGF algorithms and trailerField values does not match or if the salt length in key parameters is larger than the value in signature parameters. |
isDigestEqual | back to summary |
---|---|
private boolean isDigestEqual(String stdAlg, String givenAlg) |
isPrivateKeyValid | back to summary |
---|---|
private void isPrivateKeyValid(RSAPrivateKey prKey) throws InvalidKeyException Validate the specified RSAPrivateKey |
isPublicKeyValid | back to summary |
---|---|
private void isPublicKeyValid(RSAPublicKey pKey) throws InvalidKeyException Validate the specified RSAPublicKey |
isValid | back to summary |
---|---|
private void isValid(RSAKey rsaKey) throws InvalidKeyException Validate the specified RSAKey and its associated parameters against internal signature parameters. |
resetDigest | back to summary |
---|---|
private void resetDigest() Reset the message digest if it is not already reset. |
validateSigParams | back to summary |
---|---|
private PSSParameterSpec validateSigParams(AlgorithmParameterSpec p) throws InvalidAlgorithmParameterException Validate the specified Signature PSS parameters. |