Enum SignatureAlgorithm

    • Method Detail

      • values

        public static SignatureAlgorithm[] 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 SignatureAlgorithm 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
      • forXML

        public static SignatureAlgorithm forXML​(String xmlName,
                                                SignatureAlgorithm defaultValue)
        This method return the SignatureAlgorithm or the default value if the algorithm is unknown.
        Parameters:
        xmlName - XML URI of the given algorithm
        defaultValue - the default value to be returned if not found
        Returns:
        SignatureAlgorithm or default value
      • forJAVA

        public static SignatureAlgorithm forJAVA​(String javaName)
        For given signature algorithm and digest algorithm this function returns the Java form of the signature algorithm Signature Algorithms The algorithm names in this section can be specified when generating an instance of Signature. NONEwithRSA - The RSA signature algorithm which does not use a digesting algorithm (e.g. MD5/SHA1) before performing the RSA operation. For more information about the RSA Signature algorithms, please see PKCS1. MD2withRSA MD5withRSA - The MD2/MD5 with RSA Encryption signature algorithm which uses the MD2/MD5 digest algorithm and RSA to create and verify RSA digital signatures as defined in PKCS1. SHA1withRSA SHA256withRSA SHA384withRSA SHA512withRSA - The signature algorithm with SHA-* and the RSA encryption algorithm as defined in the OSI Interoperability Workshop, using the padding conventions described in PKCS1. NONEwithDSA - The Digital Signature Algorithm as defined in FIPS PUB 186-2. The data must be exactly 20 bytes in length. This algorithms is also known under the alias name of rawDSA. SHA1withDSA - The DSA with SHA-1 signature algorithm which uses the SHA-1 digest algorithm and DSA to create and verify DSA digital signatures as defined in FIPS PUB 186. NONEwithECDSA SHA1withECDSA SHA256withECDSA SHA384withECDSA SHA512withECDSA (ECDSA) - The ECDSA signature algorithms as defined in ANSI X9.62. Note:"ECDSA" is an ambiguous name for the "SHA1withECDSA" algorithm and should not be used. The formal name "SHA1withECDSA" should be used instead. <digest>with<encryption> - Use this to form a name for a signature algorithm with a particular message digest (such as MD2 or MD5) and algorithm (such as RSA or DSA), just as was done for the explicitly-defined standard names in this section (MD2withRSA, etc.). For the new signature schemes defined in PKCS1 v 2.0, for which the <digest>with<encryption> form is insufficient, <digest>with<encryption>and<mgf> can be used to form a name. Here, <mgf> should be replaced by a mask generation function such as MGF1. Example: MD5withRSAandMGF1.
        Parameters:
        javaName - the java name
        Returns:
        the corresponding SignatureAlgorithm
      • getAlgorithm

        public static SignatureAlgorithm getAlgorithm​(EncryptionAlgorithm encryptionAlgorithm,
                                                      DigestAlgorithm digestAlgorithm)
        For given encryption algorithm and digest algorithm this function returns the signature algorithm.
        Parameters:
        encryptionAlgorithm - the encryption algorithm
        digestAlgorithm - the digest algorithm
        Returns:
        the corresponding combination of both algorithms
      • getAlgorithm

        public static SignatureAlgorithm getAlgorithm​(EncryptionAlgorithm encryptionAlgorithm,
                                                      DigestAlgorithm digestAlgorithm,
                                                      MaskGenerationFunction mgf)
        For given encryption algorithm and digest algorithm this function returns the signature algorithm.
        Parameters:
        encryptionAlgorithm - the encryption algorithm
        digestAlgorithm - the digest algorithm
        mgf - the mask generation function
        Returns:
        the corresponding combination of both algorithms
      • getEncryptionAlgorithm

        public EncryptionAlgorithm getEncryptionAlgorithm()
        This method returns the encryption algorithm.
        Returns:
        the encryption algorithm
      • getDigestAlgorithm

        public DigestAlgorithm getDigestAlgorithm()
        This method returns the digest algorithm.
        Returns:
        the digest algorithm
      • getMaskGenerationFunction

        public MaskGenerationFunction getMaskGenerationFunction()
        This method returns the mask generation function.
        Returns:
        the mask generation function
      • getUri

        public String getUri()
        Returns the XML ID of the signature algorithm.
        Specified by:
        getUri in interface UriBasedEnum
        Returns:
        the XML URI for the current signature algorithm.
      • getOid

        public String getOid()
        Returns the OID of the signature algorithm.
        Specified by:
        getOid in interface OidBasedEnum
        Returns:
        the OID for the current signature algorithm.
      • getURIBasedOnOID

        public String getURIBasedOnOID()
        Returns the URI of the signature algorithm generated from its OID: Ex.: OID = 1.2.4.5.6.8 becomes URI = urn:oid:1.2.4.5.6.8 Note: see RFC 3061 "A URN Namespace of Object Identifiers"
        Returns:
        URI based on the algorithm's OID
      • getJCEId

        public String getJCEId()
        Returns algorithm identifier corresponding to JAVA JCE class names.
        Returns:
        the java name for the current signature algorithm.