Class SignatureAlgorithm
java.lang.Object
org.apache.xml.security.utils.ElementProxy
org.apache.xml.security.algorithms.Algorithm
org.apache.xml.security.algorithms.SignatureAlgorithm
Allows selection of digital signature's algorithm, private keys, other security parameters, and algorithm's ID.
- Author:
- Christian Geuer-Pollmann
-
Field Summary
FieldsFields inherited from class ElementProxy
_baseURI, _constructionElement, _doc, _state, MODE_CREATE, MODE_DECRYPT, MODE_ENCRYPT, MODE_PROCESS, MODE_SIGN, MODE_UNKNOWN, MODE_VERIFY -
Constructor Summary
ConstructorsConstructorDescriptionSignatureAlgorithm(Document doc, String algorithmURI) Constructor SignatureAlgorithmSignatureAlgorithm(Document doc, String algorithmURI, int HMACOutputLength) Constructor SignatureAlgorithmSignatureAlgorithm(Element element, String BaseURI) Constructor SignatureAlgorithm -
Method Summary
Modifier and TypeMethodDescriptionMethod getBaseLocalNameMethod getBaseNamespaceProxy method forSignature.getAlgorithm()which is executed on the internalSignatureobject.Method getJCEProviderNamefinal StringgetURI()Returns the URI representation of Transformation algorithmvoidProxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.voidinitSign(Key signingKey, SecureRandom secureRandom) Proxy method forSignature.initSign(java.security.PrivateKey, java.security.SecureRandom)which is executed on the internalSignatureobject.voidinitSign(Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) Proxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.voidinitVerify(Key verificationKey) Proxy method forSignature.initVerify(java.security.PublicKey)which is executed on the internalSignatureobject.static voidInitalizes for thisTransformstatic voidRegisters implementing class of the Transform algorithm with algorithmURIvoidsetParameter(AlgorithmParameterSpec params) Proxy method forSignature.setParameter(java.security.spec.AlgorithmParameterSpec)which is executed on the internalSignatureobject.byte[]sign()Proxy method forSignature.sign()which is executed on the internalSignatureobject.voidupdate(byte input) Proxy method forSignature.update(byte)which is executed on the internalSignatureobject.voidupdate(byte[] input) Proxy method forSignature.update(byte[])which is executed on the internalSignatureobject.voidupdate(byte[] buf, int offset, int len) Proxy method forSignature.update(byte[], int, int)which is executed on the internalSignatureobject.booleanverify(byte[] signature) Proxy method forSignature.verify(byte[])which is executed on the internalSignatureobject.Methods inherited from class Algorithm
getAlgorithmURI, setAlgorithmURIMethods inherited from class ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, guaranteeThatElementInCorrectSpace, length, setDefaultPrefix, setElement, setXPathNamespaceContext
-
Field Details
-
_signatureAlgorithm
Field _signatureAlgorithm
-
-
Constructor Details
-
SignatureAlgorithm
Constructor SignatureAlgorithm- Parameters:
doc-algorithmURI-- Throws:
XMLSecurityException
-
SignatureAlgorithm
public SignatureAlgorithm(Document doc, String algorithmURI, int HMACOutputLength) throws XMLSecurityException Constructor SignatureAlgorithm- Parameters:
doc-algorithmURI-HMACOutputLength-- Throws:
XMLSecurityException
-
SignatureAlgorithm
Constructor SignatureAlgorithm- Parameters:
element-BaseURI-- Throws:
XMLSecurityException
-
-
Method Details
-
sign
Proxy method forSignature.sign()which is executed on the internalSignatureobject.- Returns:
- the result of the
Signature.sign()method - Throws:
XMLSignatureException
-
getJCEAlgorithmString
Proxy method forSignature.getAlgorithm()which is executed on the internalSignatureobject.- Returns:
- the result of the
Signature.getAlgorithm()method
-
getJCEProviderName
Method getJCEProviderName- Returns:
- The Provider of this Signature Alogrithm
-
update
Proxy method forSignature.update(byte[])which is executed on the internalSignatureobject.- Parameters:
input-- Throws:
XMLSignatureException
-
update
Proxy method forSignature.update(byte)which is executed on the internalSignatureobject.- Parameters:
input-- Throws:
XMLSignatureException
-
update
Proxy method forSignature.update(byte[], int, int)which is executed on the internalSignatureobject.- Parameters:
buf-offset-len-- Throws:
XMLSignatureException
-
initSign
Proxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.- Parameters:
signingKey-- Throws:
XMLSignatureException
-
initSign
Proxy method forSignature.initSign(java.security.PrivateKey, java.security.SecureRandom)which is executed on the internalSignatureobject.- Parameters:
signingKey-secureRandom-- Throws:
XMLSignatureException
-
initSign
public void initSign(Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) throws XMLSignatureException Proxy method forSignature.initSign(java.security.PrivateKey)which is executed on the internalSignatureobject.- Parameters:
signingKey-algorithmParameterSpec-- Throws:
XMLSignatureException
-
setParameter
Proxy method forSignature.setParameter(java.security.spec.AlgorithmParameterSpec)which is executed on the internalSignatureobject.- Parameters:
params-- Throws:
XMLSignatureException
-
initVerify
Proxy method forSignature.initVerify(java.security.PublicKey)which is executed on the internalSignatureobject.- Parameters:
verificationKey-- Throws:
XMLSignatureException
-
verify
Proxy method forSignature.verify(byte[])which is executed on the internalSignatureobject.- Parameters:
signature-- Returns:
- true if if the signature is valid.
- Throws:
XMLSignatureException
-
getURI
Returns the URI representation of Transformation algorithm- Returns:
- the URI representation of Transformation algorithm
-
providerInit
public static void providerInit()Initalizes for thisTransform -
register
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException, XMLSignatureException Registers implementing class of the Transform algorithm with algorithmURI- Parameters:
algorithmURI- algorithmURI URI representation ofTransform algorithm.implementingClass-implementingClassthe implementing class ofSignatureAlgorithmSpi- Throws:
AlgorithmAlreadyRegisteredException- if specified algorithmURI is already registeredXMLSignatureException
-
getBaseNamespace
Method getBaseNamespace- Specified by:
getBaseNamespacein classElementProxy- Returns:
- URI of this element
-
getBaseLocalName
Method getBaseLocalName- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- Local name
-