public abstract class RsaPssSignature extends RsaSignature
The RSA-PSS signature algorithm combines the RSA signature and verification primitives with the PSS encoding method. The lengths of messages on which RSA-PSS can operate is either unrestricted or constrained by a very large number, depending on the hash function used in the underlying PSS encoding method. The hash function used by the algorithm can be selected at initialization time by passing in appropriate RSA-PSS algorithm parameters.
RSA-PSS Signature Generation
m to
produce an encoded message EM of length k (where
k is the length in bytes of the RSA modulus n).EM to
produce the signature S.RSA-PSS Signature Verification
S being verified to produce the encoded message EM.
M
and the encoded message EM to determine whether they are
consistent.M and the encoded message EM are
consistent; the signature is valid, otherwise the signature is invalid.The PSS encoding and verification operations are parameterized by choice of hash function, mask generation function, and salt length. Further details on the RSA PSS encoding and verification operations are not provided here; for more information refer to PKCS #1: RSA Cryptography Standard.
RSA-PSS is different from other RSA-based signature schemes in that it is probabilistic rather than deterministic, incorporating a randomly generated salt value. The salt value enhances the security of the scheme by affording a "tighter" security proof than deterministic alternatives. RSA-PSS is the successor to RSA-PKCS1-v1_5; although no known attacks are known against RSA-PKCS1-v1_5, in the interest of robustness, RSA-PSS is recommended for eventual adoption in new applications.
This digital signature algorithm implementation requires parameters when initialized for signature generation. If algorithm parameters are not provided, a default set will automatically be used. The following algorithm parameter representations are supported:
The default parameters are represented as an RSAPSSParameterSpec
instance that with the following parameter values set.
sha1: {OID id-sha1 PARAMETERS NULL}mgf1SHA1: {OID id-mgf1 PARAMETERS sha1}201An RSA-PSS digital signature algorithm instance can be obtained using the Java Cryptography Architecture (JCA), by requesting the '<algorithm>' digital signature from the cryptographic service provider. This can be done using the following call:
Signature.getInstance("<algorithm>", "Entrust");
This implementation calculates the hash internally, thus it is the message
itself (being signed or verified) that is passed in through the
update() API.
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertParametersValid(java.security.spec.AlgorithmParameterSpec params)
Checks the parameters to ensure that they are valid and appropriate for
this digital signature algorithm.
|
protected java.security.spec.AlgorithmParameterSpec |
generateDefaultParameters()
Returns a default set of parameters that are valid and appropriate for
this digital signature algorithm.
|
protected java.security.AlgorithmParameters |
toAlgorithmParameters(java.security.spec.AlgorithmParameterSpec paramSpec)
Converts algorithm parameters in transparent representation into their
opaque representation during a call to
engineGetParameters()
. |
getDigitalSignatureImplengineGetParameter, engineGetParameters, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineSign, engineUpdate, engineUpdate, engineVerify, engineVerify, getDigest, getPrngprotected final java.security.spec.AlgorithmParameterSpec generateDefaultParameters()
DigitalSignature
This default implementation is only appropriate for algorithms that do
not support algorithm parameters; it always returns null.
For algorithms that do support algorithm parameters, this API must be
overridden to generate a valid and appropriate set of default algorithm
parameters. These parameters will automatically be used when parameters
are not provided through the engineSetParameter() API and
the algorithm is initialized for signature generation.
generateDefaultParameters in class DigitalSignaturenull if
this algorithm does not support parametersprotected final void assertParametersValid(java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
DigitalSignature
This default implementation is only appropriate for algorithms that do
not support algorithm parameters; it throws an
InvalidAlgorithmParameterException indicating that
parameters are not supported when non-null parameters are provided. For
algorithms that do support algorithm parameters, this API must be
overridden to check that the parameters that were passed in are valid and
appropriate for the algorithm.
assertParametersValid in class DigitalSignatureparams - the parametersjava.security.InvalidAlgorithmParameterException - if the given parameters are inappropriate for this signature
algorithmprotected final java.security.AlgorithmParameters toAlgorithmParameters(java.security.spec.AlgorithmParameterSpec paramSpec)
DigitalSignatureengineGetParameters()
.
This default implementation is only appropriate for algorithms that do
not support algorithm parameters; it always returns null.
For algorithms that do support algorithm parameters, this API must be
overridden to convert supported parameters in transparent representation
to opaque representation.
toAlgorithmParameters in class DigitalSignatureparamSpec - a transparent representation of the algorithm parametersnull if this algorithm does not support parameters