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>, java.lang.constant.Constable

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. See ECryptoAlgorithmCrypt for encryption algorithms.
Note: Mendelson uses the RFC 5751 identifiers.
Author:
Philip Helger
  • Enum Constant Details

    • 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_SHA1
      Old version as of RFC 3851.
    • DIGEST_SHA256

      @DevelopersNote("Use DIGEST_SHA_256 instead") public static final ECryptoAlgorithmSign DIGEST_SHA256
      Old version as of RFC 3851.
    • DIGEST_SHA384

      @DevelopersNote("Use DIGEST_SHA_384 instead") public static final ECryptoAlgorithmSign DIGEST_SHA384
      Old version as of RFC 3851.
    • DIGEST_SHA512

      @DevelopersNote("Use DIGEST_SHA_512 instead") public static final ECryptoAlgorithmSign DIGEST_SHA512
      Old 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.
    • DIGEST_SHA2_224

      public static final ECryptoAlgorithmSign DIGEST_SHA2_224
      Non-compliant version of SHA-224 algorithm
      Since:
      5.0.1 and 5.1.1
    • DIGEST_SHA2_256

      public static final ECryptoAlgorithmSign DIGEST_SHA2_256
      Non-compliant version of SHA-256 algorithm
      Since:
      5.0.1 and 5.1.1
    • DIGEST_SHA2_384

      public static final ECryptoAlgorithmSign DIGEST_SHA2_384
      Non-compliant version of SHA-384 algorithm
      Since:
      5.0.1 and 5.1.1
    • DIGEST_SHA2_512

      public static final ECryptoAlgorithmSign DIGEST_SHA2_512
      Non-compliant version of SHA-512 algorithm
      Since:
      5.0.1 and 5.1.1
    • 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 Details

  • Method Details

    • values

      public static ECryptoAlgorithmSign[] 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

      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 name
      NullPointerException - 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:
      getID in interface com.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. Never null.
      Specified by:
      getOID in interface ICryptoAlgorithm
      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:
      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

      @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)