Class SignatureECDSA
- java.lang.Object
-
- org.apache.xml.security.algorithms.SignatureAlgorithmSpi
-
- org.apache.xml.security.algorithms.implementations.SignatureECDSA
-
- Direct Known Subclasses:
SignatureECDSA.SignatureECDSARIPEMD160,SignatureECDSA.SignatureECDSASHA1,SignatureECDSA.SignatureECDSASHA224,SignatureECDSA.SignatureECDSASHA256,SignatureECDSA.SignatureECDSASHA384,SignatureECDSA.SignatureECDSASHA512
public abstract class SignatureECDSA extends SignatureAlgorithmSpi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSignatureECDSA.SignatureECDSARIPEMD160Class SignatureECDSARIPEMD160static classSignatureECDSA.SignatureECDSASHA1Class SignatureECDSASHA1static classSignatureECDSA.SignatureECDSASHA224Class SignatureECDSASHA224static classSignatureECDSA.SignatureECDSASHA256Class SignatureECDSASHA256static classSignatureECDSA.SignatureECDSASHA384Class SignatureECDSASHA384static classSignatureECDSA.SignatureECDSASHA512Class SignatureECDSASHA512
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGprivate java.security.SignaturesignatureAlgorithmField algorithm
-
Constructor Summary
Constructors Constructor Description SignatureECDSA()Constructor SignatureRSA
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static byte[]convertASN1toXMLDSIG(byte[] asn1Bytes)Converts an ASN.1 ECDSA value to a XML Signature ECDSA Value.static byte[]convertXMLDSIGtoASN1(byte[] xmldsigBytes)Converts a XML Signature ECDSA Value to an ASN.1 DSA value.protected java.lang.StringengineGetJCEAlgorithmString()Proxy method forSignature.getAlgorithm()which is executed on the internalSignatureobject.protected java.lang.StringengineGetJCEProviderName()Method engineGetJCEProviderNameabstract java.lang.StringengineGetURI()Returns the URI representation ofTransformation algorithmprotected voidengineInitSign(java.security.Key privateKey)Proxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.protected voidengineInitSign(java.security.Key privateKey, java.security.SecureRandom secureRandom)Proxy method forSignature.initSign(java.security.PrivateKey, java.security.SecureRandom)which is executed on the internalSignatureobject.protected voidengineInitSign(java.security.Key signingKey, java.security.spec.AlgorithmParameterSpec algorithmParameterSpec)Proxy method forMacwhich is executed on the internalMac.init(Key)object.protected voidengineInitVerify(java.security.Key publicKey)Method engineInitVerifyprotected voidengineSetHMACOutputLength(int HMACOutputLength)Method engineSetHMACOutputLengthprotected voidengineSetParameter(java.security.spec.AlgorithmParameterSpec params)Proxy method forSignature.setParameter( java.security.spec.AlgorithmParameterSpec)which is executed on the internalSignatureobject.protected byte[]engineSign()Proxy method forSignature.sign()which is executed on the internalSignatureobject.protected voidengineUpdate(byte input)Proxy method forSignature.update(byte[])which is executed on the internalSignatureobject.protected voidengineUpdate(byte[] input)Proxy method forSignature.update(byte[])which is executed on the internalSignatureobject.protected voidengineUpdate(byte[] buf, int offset, int len)Proxy method forSignature.update(byte[], int, int)which is executed on the internalSignatureobject.protected booleanengineVerify(byte[] signature)Proxy method forSignature.verify(byte[])which is executed on the internalSignatureobject.-
Methods inherited from class org.apache.xml.security.algorithms.SignatureAlgorithmSpi
engineGetContextFromElement, reset
-
-
-
-
Constructor Detail
-
SignatureECDSA
public SignatureECDSA() throws XMLSignatureExceptionConstructor SignatureRSA- Throws:
XMLSignatureException
-
-
Method Detail
-
engineGetURI
public abstract java.lang.String engineGetURI()
Returns the URI representation ofTransformation algorithm- Specified by:
engineGetURIin classSignatureAlgorithmSpi- Returns:
- the URI representation of
Transformation algorithm
-
convertASN1toXMLDSIG
public static byte[] convertASN1toXMLDSIG(byte[] asn1Bytes) throws java.io.IOExceptionConverts an ASN.1 ECDSA value to a XML Signature ECDSA Value. The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value pairs; the XML Signature requires the core BigInteger values.- Parameters:
asn1Bytes-- Returns:
- the decode bytes
- Throws:
java.io.IOException- See Also:
- 6.4.1 DSA, 3.3. ECDSA Signatures
-
convertXMLDSIGtoASN1
public static byte[] convertXMLDSIGtoASN1(byte[] xmldsigBytes) throws java.io.IOExceptionConverts a XML Signature ECDSA Value to an ASN.1 DSA value. The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value pairs; the XML Signature requires the core BigInteger values.- Parameters:
xmldsigBytes-- Returns:
- the encoded ASN.1 bytes
- Throws:
java.io.IOException- See Also:
- 6.4.1 DSA, 3.3. ECDSA Signatures
-
engineSetParameter
protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params) throws XMLSignatureExceptionProxy method forSignature.setParameter( java.security.spec.AlgorithmParameterSpec)which is executed on the internalSignatureobject.- Specified by:
engineSetParameterin classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineVerify
protected boolean engineVerify(byte[] signature) throws XMLSignatureExceptionProxy method forSignature.verify(byte[])which is executed on the internalSignatureobject.- Specified by:
engineVerifyin classSignatureAlgorithmSpi- Returns:
- true if the signature is correct
- Throws:
XMLSignatureException
-
engineInitVerify
protected void engineInitVerify(java.security.Key publicKey) throws XMLSignatureExceptionMethod engineInitVerify- Specified by:
engineInitVerifyin classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineSign
protected byte[] engineSign() throws XMLSignatureExceptionProxy method forSignature.sign()which is executed on the internalSignatureobject.- Specified by:
engineSignin classSignatureAlgorithmSpi- Returns:
- the result of the
Signature.sign()method - Throws:
XMLSignatureException
-
engineInitSign
protected void engineInitSign(java.security.Key privateKey, java.security.SecureRandom secureRandom) throws XMLSignatureExceptionProxy method forSignature.initSign(java.security.PrivateKey, java.security.SecureRandom)which is executed on the internalSignatureobject.- Specified by:
engineInitSignin classSignatureAlgorithmSpi- Throws:
XMLSignatureException- if this method is called on a MAC
-
engineInitSign
protected void engineInitSign(java.security.Key privateKey) throws XMLSignatureExceptionProxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.- Specified by:
engineInitSignin classSignatureAlgorithmSpi- Throws:
XMLSignatureException- if this method is called on a MAC
-
engineUpdate
protected void engineUpdate(byte[] input) throws XMLSignatureExceptionProxy method forSignature.update(byte[])which is executed on the internalSignatureobject.- Specified by:
engineUpdatein classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineUpdate
protected void engineUpdate(byte input) throws XMLSignatureExceptionProxy method forSignature.update(byte[])which is executed on the internalSignatureobject.- Specified by:
engineUpdatein classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineUpdate
protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureExceptionProxy method forSignature.update(byte[], int, int)which is executed on the internalSignatureobject.- Specified by:
engineUpdatein classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineGetJCEAlgorithmString
protected java.lang.String engineGetJCEAlgorithmString()
Proxy method forSignature.getAlgorithm()which is executed on the internalSignatureobject.- Specified by:
engineGetJCEAlgorithmStringin classSignatureAlgorithmSpi- Returns:
- the result of the
Signature.getAlgorithm()method
-
engineGetJCEProviderName
protected java.lang.String engineGetJCEProviderName()
Method engineGetJCEProviderName- Specified by:
engineGetJCEProviderNamein classSignatureAlgorithmSpi- Returns:
- the JCE ProviderName
-
engineSetHMACOutputLength
protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureExceptionMethod engineSetHMACOutputLength- Specified by:
engineSetHMACOutputLengthin classSignatureAlgorithmSpi- Throws:
XMLSignatureException
-
engineInitSign
protected void engineInitSign(java.security.Key signingKey, java.security.spec.AlgorithmParameterSpec algorithmParameterSpec) throws XMLSignatureExceptionProxy method forMacwhich is executed on the internalMac.init(Key)object.- Specified by:
engineInitSignin classSignatureAlgorithmSpi- Throws:
XMLSignatureException- if this method is called on a Signature
-
-