| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static Signature | |
| public static void | checkKeyAndSigAlgMatch(PrivateKey
must not be null key, String must not be null sAlg)Checks if a signature algorithm matches a key, i.e. if this signature can be initialized with this key. |
| private static String | |
| private static AlgorithmParameters | |
| private static String | ecStrength(int bitLength)
Return the default message digest algorithm based on the specified EC key size. |
| public static String | extractDigestAlgFromDwithE(String signatureAlgorithm)
Extracts the digest algorithm name from a signature algorithm name in either the "DIGESTwithENCRYPTION" or the "DIGESTwithENCRYPTIONandWHATEVER" format. |
| public static String | Returns: the key algorithm name, or null if the input is not in either of the formats.Extracts the key algorithm name from a signature algorithm name in either the "DIGESTwithENCRYPTION" or the "DIGESTwithENCRYPTIONandWHATEVER" format. |
| public static Signature | fromKey(String
signature algorithms sigAlg, PrivateKey private key key, String (optional) provider provider)Create a Signature that has been initialized with proper key and params. |
| public static Signature | fromKey(String
signature algorithms sigAlg, PrivateKey private key key, Provider (optional) provider provider)Create a Signature that has been initialized with proper key and params. |
| public static AlgorithmId | Returns: the AlgorithmId, not nullthe signature object sigEngine, PrivateKey the private key key)Derives AlgorithmId from a signature object and a key. |
| public static AlgorithmParameterSpec | getDefaultParamSpec(String sigAlg, Key k)
Returns default AlgorithmParameterSpec for a key used in a signature. |
| public static String | Returns: the default alg, might be null if unsupportedcannot be null k)Returns the default signature algorithm for a private key. |
| public static AlgorithmId | Returns: the digest algIdSignature object that tells you RSASSA-PSS params signer, String Signature algorithm sigalg, PrivateKey key tells you EdDSA params privateKey, PublicKey key tells you HSS/LMS hash algorithm publicKey, boolean Ed448 uses different digest algs depending on this directsign)Determines the digestEncryptionAlgorithmId in PKCS7 SignerInfo. |
| public static AlgorithmParameterSpec | Returns: an AlgorithmParameterSpec, null ifparams is nullsignature algorithm sigName, AlgorithmParameters (optional) parameters params)Utility method for converting the specified AlgorithmParameters object into an AlgorithmParameterSpec object. |
| public static AlgorithmParameterSpec | Returns: an AlgorithmParameterSpec, null ifparamBytes is nullsignature algorithm sigName, byte[] (optional) parameter bytes paramBytes)Utility method for converting the specified parameter bytes into an AlgorithmParameterSpec object. |
| private static String | ifcFfcStrength(int bitLength)
Return the default message digest algorithm based on both the security strength of the specified IFC/FFC key size, i.e. RSA, RSASSA-PSS, and the recommendation from NIST CNSA, e.g. use SHA-384 and min 3072-bit. |
| public static void | |
| public static void | |
| public static void |
| SignatureUtil | back to summary |
|---|---|
| public SignatureUtil() | |
| autoInitInternal | back to summary |
|---|---|
| private static Signature autoInitInternal(String alg, PrivateKey key, Signature s) throws InvalidKeyException | |
| checkKeyAndSigAlgMatch | back to summary |
|---|---|
| public static void checkKeyAndSigAlgMatch(PrivateKey key, String sAlg) Checks if a signature algorithm matches a key, i.e. if this
signature can be initialized with this key. Currently used
in Note Unknown signature algorithms are allowed.
| |
| checkName | back to summary |
|---|---|
| private static String checkName(String algName) Convert OID.1.2.3.4 or 1.2.3.4 to its matching stdName, and return upper case algorithm name. | |
| createAlgorithmParameters | back to summary |
|---|---|
| private static AlgorithmParameters createAlgorithmParameters(String algName, byte[] paramBytes) throws ProviderException | |
| ecStrength | back to summary |
|---|---|
| private static String ecStrength(int bitLength) Return the default message digest algorithm based on the specified
EC key size.
Attention: sync with the @implNote inside
| |
| extractDigestAlgFromDwithE | back to summary |
|---|---|
| public static String extractDigestAlgFromDwithE(String signatureAlgorithm) Extracts the digest algorithm name from a signature algorithm name in either the "DIGESTwithENCRYPTION" or the "DIGESTwithENCRYPTIONandWHATEVER" format. It's OK to return "SHA1" instead of "SHA-1". | |
| extractKeyAlgFromDwithE | back to summary |
|---|---|
| public static String extractKeyAlgFromDwithE(String signatureAlgorithm) Extracts the key algorithm name from a signature algorithm name in either the "DIGESTwithENCRYPTION" or the "DIGESTwithENCRYPTIONandWHATEVER" format.
| |
| fromKey | back to summary |
|---|---|
| public static Signature fromKey(String sigAlg, PrivateKey key, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException Create a Signature that has been initialized with proper key and params.
| |
| fromKey | back to summary |
|---|---|
| public static Signature fromKey(String sigAlg, PrivateKey key, Provider provider) throws NoSuchAlgorithmException, InvalidKeyException Create a Signature that has been initialized with proper key and params.
| |
| fromSignature | back to summary |
|---|---|
| public static AlgorithmId fromSignature(Signature sigEngine, PrivateKey key) throws SignatureException Derives AlgorithmId from a signature object and a key.
| |
| getDefaultParamSpec | back to summary |
|---|---|
| public static AlgorithmParameterSpec getDefaultParamSpec(String sigAlg, Key k) Returns default AlgorithmParameterSpec for a key used in a signature. This is only useful for RSASSA-PSS now, which is the only algorithm that must be initialized with a AlgorithmParameterSpec now. | |
| getDefaultSigAlgForKey | back to summary |
|---|---|
| public static String getDefaultSigAlgForKey(PrivateKey k) Returns the default signature algorithm for a private key.
| |
| getDigestAlgInPkcs7SignerInfo | back to summary |
|---|---|
| public static AlgorithmId getDigestAlgInPkcs7SignerInfo(Signature signer, String sigalg, PrivateKey privateKey, PublicKey publicKey, boolean directsign) throws NoSuchAlgorithmException Determines the digestEncryptionAlgorithmId in PKCS7 SignerInfo.
| |
| getParamSpec | back to summary |
|---|---|
| public static AlgorithmParameterSpec getParamSpec(String sigName, AlgorithmParameters params) throws ProviderException Utility method for converting the specified AlgorithmParameters object into an AlgorithmParameterSpec object.
| |
| getParamSpec | back to summary |
|---|---|
| public static AlgorithmParameterSpec getParamSpec(String sigName, byte[] paramBytes) throws ProviderException Utility method for converting the specified parameter bytes into an AlgorithmParameterSpec object.
| |
| ifcFfcStrength | back to summary |
|---|---|
| private static String ifcFfcStrength(int bitLength) Return the default message digest algorithm based on both the
security strength of the specified IFC/FFC key size, i.e. RSA,
RSASSA-PSS, and the recommendation from NIST CNSA, e.g. use SHA-384
and min 3072-bit.
Attention: sync with the @implNote inside
| |
| initSignWithParam | back to summary |
|---|---|
| public static void initSignWithParam(Signature s, PrivateKey key, AlgorithmParameterSpec params, SecureRandom sr) throws InvalidAlgorithmParameterException, InvalidKeyException | |
| initVerifyWithParam | back to summary |
|---|---|
| public static void initVerifyWithParam(Signature s, PublicKey key, AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException, InvalidKeyException | |
| initVerifyWithParam | back to summary |
|---|---|
| public static void initVerifyWithParam(Signature s, Certificate cert, AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException, InvalidKeyException | |
| Modifier and Type | Field and Description |
|---|---|
| public static final AlgorithmId | |
| public static final AlgorithmId | |
| public static final AlgorithmId |
| Access | Constructor and Description |
|---|---|
| public |
| sha512 | back to summary |
|---|---|
| public static final AlgorithmId sha512 | |
| shake256_512 | back to summary |
|---|---|
| public static final AlgorithmId shake256_512 | |
| shake256lenWith512 | back to summary |
|---|---|
| public static final AlgorithmId shake256lenWith512 | |
| DigestAlgHolder | back to summary |
|---|---|
| public DigestAlgHolder() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final PSSParameterSpec | |
| pack-priv static final PSSParameterSpec | |
| pack-priv static final PSSParameterSpec |
| Access | Constructor and Description |
|---|---|
| private |
| PSS_256_SPEC | back to summary |
|---|---|
| pack-priv static final PSSParameterSpec PSS_256_SPEC | |
| PSS_384_SPEC | back to summary |
|---|---|
| pack-priv static final PSSParameterSpec PSS_384_SPEC | |
| PSS_512_SPEC | back to summary |
|---|---|
| pack-priv static final PSSParameterSpec PSS_512_SPEC | |
| PSSParamsHolder | back to summary |
|---|---|
| private PSSParamsHolder() | |