Package com.helger.as2lib.crypto
Enum ECryptoAlgorithmSign
- All Implemented Interfaces:
ICryptoAlgorithm
,com.helger.commons.id.IHasID<String>
,Serializable
,Comparable<ECryptoAlgorithmSign>
,java.lang.constant.Constable
This enum contains all signing supported crypto algorithms. The algorithms
contained in here may not be used for encryption of anything. See
Note: Mendelson uses the RFC 5751 identifiers.
ECryptoAlgorithmCrypt
for encryption algorithms.Note: Mendelson uses the RFC 5751 identifiers.
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSame for RFC 3851 and RFC 5751Deprecated.Deprecated.New version as of RFC 5751.New version as of RFC 5751.New version as of RFC 5751.New version as of RFC 5751.New version as of RFC 5751.Old version as of RFC 3851.Non-compliant version of SHA-224 algorithmNon-compliant version of SHA-256 algorithmNon-compliant version of SHA-384 algorithmNon-compliant version of SHA-512 algorithmOld version as of RFC 3851.Old version as of RFC 3851.Old version as of RFC 3851.RSASSA-PSS with digest algorithm SHA224.RSASSA-PSS with digest algorithm SHA256RSASSA-PSS with digest algorithm SHA3-224RSASSA-PSS with digest algorithm SHA3-256RSASSA-PSS with digest algorithm SHA3-384RSASSA-PSS with digest algorithm SHA3-512RSASSA-PSS with digest algorithm SHA384RSASSA-PSS with digest algorithm SHA512 -
Field Summary
Modifier and TypeFieldDescriptionstatic final ECryptoAlgorithmSign
static final ECryptoAlgorithmSign
-
Method Summary
Modifier and TypeMethodDescriptionstatic ECryptoAlgorithmSign
getFromIDOrDefault
(String sID, ECryptoAlgorithmSign eDefault) static ECryptoAlgorithmSign
getFromIDOrNull
(String sID) static ECryptoAlgorithmSign
getFromIDOrThrow
(String sID) getID()
Returns the Signature ID as the combination of the signature algorithm and the digest algorithm.org.bouncycastle.asn1.ASN1ObjectIdentifier
getOID()
The OID with which the message digest is created.boolean
boolean
static ECryptoAlgorithmSign
Returns the enum constant of this type with the specified name.static ECryptoAlgorithmSign[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DIGEST_RSA_MD5
@Deprecated @DevelopersNote("Use DIGEST_MD5 instead") public static final ECryptoAlgorithmSign DIGEST_RSA_MD5Deprecated.See compatibility note in RFC 5751, section 3.4.3.1 -
DIGEST_RSA_SHA1
@Deprecated @DevelopersNote("Use DIGEST_SHA1 or DIGEST_SHA_1 instead") public static final ECryptoAlgorithmSign DIGEST_RSA_SHA1Deprecated.See compatibility note in RFC 5751, section 3.4.3.1 -
DIGEST_MD5
Same for RFC 3851 and RFC 5751 -
DIGEST_SHA1
Old version as of RFC 3851. -
DIGEST_SHA256
@DevelopersNote("Use DIGEST_SHA_256 instead") public static final ECryptoAlgorithmSign DIGEST_SHA256Old version as of RFC 3851. -
DIGEST_SHA384
@DevelopersNote("Use DIGEST_SHA_384 instead") public static final ECryptoAlgorithmSign DIGEST_SHA384Old version as of RFC 3851. -
DIGEST_SHA512
@DevelopersNote("Use DIGEST_SHA_512 instead") public static final ECryptoAlgorithmSign DIGEST_SHA512Old version as of RFC 3851. -
DIGEST_SHA_1
New version as of RFC 5751. -
DIGEST_SHA_224
New version as of RFC 5751. -
DIGEST_SHA_256
New version as of RFC 5751. -
DIGEST_SHA_384
New version as of RFC 5751. -
DIGEST_SHA_512
New version as of RFC 5751. -
DIGEST_SHA2_224
Non-compliant version of SHA-224 algorithm- Since:
- 5.0.1 and 5.1.1
-
DIGEST_SHA2_256
Non-compliant version of SHA-256 algorithm- Since:
- 5.0.1 and 5.1.1
-
DIGEST_SHA2_384
Non-compliant version of SHA-384 algorithm- Since:
- 5.0.1 and 5.1.1
-
DIGEST_SHA2_512
Non-compliant version of SHA-512 algorithm- Since:
- 5.0.1 and 5.1.1
-
RSASSA_PSS_WITH_SHA224
RSASSA-PSS with digest algorithm SHA224.- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA256
RSASSA-PSS with digest algorithm SHA256- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA384
RSASSA-PSS with digest algorithm SHA384- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA512
RSASSA-PSS with digest algorithm SHA512- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_224
RSASSA-PSS with digest algorithm SHA3-224- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_256
RSASSA-PSS with digest algorithm SHA3-256- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_384
RSASSA-PSS with digest algorithm SHA3-384- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_512
RSASSA-PSS with digest algorithm SHA3-512- Since:
- 5.0.0
-
-
Field Details
-
DEFAULT_RFC_3851
-
DEFAULT_RFC_5751
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getID
Returns the Signature ID as the combination of the signature algorithm and the digest algorithm.- Specified by:
getID
in interfacecom.helger.commons.id.IHasID<String>
-
getMICAlgorithmID
- Returns:
- the MIC algorithm ID. That is the value that is added into the "micalg" Content-Type parameter of the "Content-Type" header.
-
getOID
The OID with which the message digest is created. Nevernull
.- Specified by:
getOID
in interfaceICryptoAlgorithm
- Returns:
- The ASN.1 object identifier of the crypto/sign algorithm. Never
null
.
-
getSignAlgorithmName
- Returns:
- The algorithm name to be used for BouncyCastle to do the SMIME packaging.
-
isRFC3851Algorithm
public boolean isRFC3851Algorithm()- Returns:
true
if this is an algorithm defined by RFC 3851,false
otherwise. Please note that some algorithms are contained in both algorithm sets!- Since:
- 4.2.0
-
isRFC5751Algorithm
public boolean isRFC5751Algorithm()- Returns:
true
if this is an algorithm defined by RFC 5751,false
otherwise. Please note that some algorithms are contained in both algorithm sets!- Since:
- 4.2.0
-
getFromIDOrNull
-
getFromIDOrThrow
-
getFromIDOrDefault
@Nullable public static ECryptoAlgorithmSign getFromIDOrDefault(@Nullable String sID, @Nullable ECryptoAlgorithmSign eDefault)
-