Package com.helger.as2lib.crypto
Enum ECryptoAlgorithmSign
- java.lang.Object
-
- java.lang.Enum<ECryptoAlgorithmSign>
-
- com.helger.as2lib.crypto.ECryptoAlgorithmSign
-
- All Implemented Interfaces:
ICryptoAlgorithm,com.helger.commons.id.IHasID<String>,Serializable,Comparable<ECryptoAlgorithmSign>
public enum ECryptoAlgorithmSign extends Enum<ECryptoAlgorithmSign> implements ICryptoAlgorithm
This enum contains all signing supported crypto algorithms. The algorithms contained in here may not be used for encryption of anything. SeeECryptoAlgorithmCryptfor encryption algorithms.
Note: Mendelson uses the RFC 5751 identifiers.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DIGEST_MD5Same for RFC 3851 and RFC 5751DIGEST_RSA_MD5Deprecated.DIGEST_RSA_SHA1Deprecated.DIGEST_SHA_1New version as of RFC 5751.DIGEST_SHA_224New version as of RFC 5751.DIGEST_SHA_256New version as of RFC 5751.DIGEST_SHA_384New version as of RFC 5751.DIGEST_SHA_512New version as of RFC 5751.DIGEST_SHA1Old version as of RFC 3851.DIGEST_SHA256Old version as of RFC 3851.DIGEST_SHA384Old version as of RFC 3851.DIGEST_SHA512Old version as of RFC 3851.RSASSA_PSS_WITH_SHA224RSASSA-PSS with digest algorithm SHA224.RSASSA_PSS_WITH_SHA256RSASSA-PSS with digest algorithm SHA256RSASSA_PSS_WITH_SHA3_224RSASSA-PSS with digest algorithm SHA3-224RSASSA_PSS_WITH_SHA3_256RSASSA-PSS with digest algorithm SHA3-256RSASSA_PSS_WITH_SHA3_384RSASSA-PSS with digest algorithm SHA3-384RSASSA_PSS_WITH_SHA3_512RSASSA-PSS with digest algorithm SHA3-512RSASSA_PSS_WITH_SHA384RSASSA-PSS with digest algorithm SHA384RSASSA_PSS_WITH_SHA512RSASSA-PSS with digest algorithm SHA512
-
Field Summary
Fields Modifier and Type Field Description static ECryptoAlgorithmSignDEFAULT_RFC_3851static ECryptoAlgorithmSignDEFAULT_RFC_5751
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ECryptoAlgorithmSigngetFromIDOrDefault(String sID, ECryptoAlgorithmSign eDefault)static ECryptoAlgorithmSigngetFromIDOrNull(String sID)static ECryptoAlgorithmSigngetFromIDOrThrow(String sID)StringgetID()Returns the Signature ID as the combination of the signature algorithm and the digest algorithm.StringgetMICAlgorithmID()org.bouncycastle.asn1.ASN1ObjectIdentifiergetOID()The OID with which the message digest is created.StringgetSignAlgorithmName()booleanisRFC3851Algorithm()booleanisRFC5751Algorithm()static ECryptoAlgorithmSignvalueOf(String name)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 Detail
-
DIGEST_RSA_MD5
@Deprecated @DevelopersNote("Use DIGEST_MD5 instead") public static final ECryptoAlgorithmSign DIGEST_RSA_MD5
Deprecated.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_SHA1
Deprecated.See compatibility note in RFC 5751, section 3.4.3.1
-
DIGEST_MD5
public static final ECryptoAlgorithmSign DIGEST_MD5
Same for RFC 3851 and RFC 5751
-
DIGEST_SHA1
@DevelopersNote("Use DIGEST_SHA_1 instead") public static final ECryptoAlgorithmSign DIGEST_SHA1Old 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
public static final ECryptoAlgorithmSign DIGEST_SHA_1
New version as of RFC 5751.
-
DIGEST_SHA_224
public static final ECryptoAlgorithmSign DIGEST_SHA_224
New version as of RFC 5751.
-
DIGEST_SHA_256
public static final ECryptoAlgorithmSign DIGEST_SHA_256
New version as of RFC 5751.
-
DIGEST_SHA_384
public static final ECryptoAlgorithmSign DIGEST_SHA_384
New version as of RFC 5751.
-
DIGEST_SHA_512
public static final ECryptoAlgorithmSign DIGEST_SHA_512
New version as of RFC 5751.
-
RSASSA_PSS_WITH_SHA224
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA224
RSASSA-PSS with digest algorithm SHA224.- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA256
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA256
RSASSA-PSS with digest algorithm SHA256- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA384
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA384
RSASSA-PSS with digest algorithm SHA384- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA512
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA512
RSASSA-PSS with digest algorithm SHA512- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_224
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA3_224
RSASSA-PSS with digest algorithm SHA3-224- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_256
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA3_256
RSASSA-PSS with digest algorithm SHA3-256- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_384
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA3_384
RSASSA-PSS with digest algorithm SHA3-384- Since:
- 5.0.0
-
RSASSA_PSS_WITH_SHA3_512
public static final ECryptoAlgorithmSign RSASSA_PSS_WITH_SHA3_512
RSASSA-PSS with digest algorithm SHA3-512- Since:
- 5.0.0
-
-
Field Detail
-
DEFAULT_RFC_3851
public static final ECryptoAlgorithmSign DEFAULT_RFC_3851
-
DEFAULT_RFC_5751
public static final ECryptoAlgorithmSign DEFAULT_RFC_5751
-
-
Method Detail
-
values
public static ECryptoAlgorithmSign[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ECryptoAlgorithmSign c : ECryptoAlgorithmSign.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ECryptoAlgorithmSign valueOf(String name)
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
@Nonnull @Nonempty public String getID()
Returns the Signature ID as the combination of the signature algorithm and the digest algorithm.- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>
-
getMICAlgorithmID
@Nonnull @Nonempty public 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
@Nonnull public org.bouncycastle.asn1.ASN1ObjectIdentifier getOID()
The OID with which the message digest is created. Nevernull.- Specified by:
getOIDin interfaceICryptoAlgorithm- Returns:
- The ASN.1 object identifier of the crypto/sign algorithm. Never
null.
-
getSignAlgorithmName
@Nonnull @Nonempty public String getSignAlgorithmName()
- Returns:
- The algorithm name to be used for BouncyCastle to do the SMIME packaging.
-
isRFC3851Algorithm
public boolean isRFC3851Algorithm()
- Returns:
trueif this is an algorithm defined by RFC 3851,falseotherwise. Please note that some algorithms are contained in both algorithm sets!- Since:
- 4.2.0
-
isRFC5751Algorithm
public boolean isRFC5751Algorithm()
- Returns:
trueif this is an algorithm defined by RFC 5751,falseotherwise. Please note that some algorithms are contained in both algorithm sets!- Since:
- 4.2.0
-
getFromIDOrNull
@Nullable public static ECryptoAlgorithmSign getFromIDOrNull(@Nullable String sID)
-
getFromIDOrThrow
@Nonnull public static ECryptoAlgorithmSign getFromIDOrThrow(@Nullable String sID)
-
getFromIDOrDefault
@Nullable public static ECryptoAlgorithmSign getFromIDOrDefault(@Nullable String sID, @Nullable ECryptoAlgorithmSign eDefault)
-
-