Class SignedInfo
java.lang.Object
org.apache.xml.security.utils.ElementProxy
org.apache.xml.security.utils.SignatureElementProxy
org.apache.xml.security.signature.Manifest
org.apache.xml.security.signature.SignedInfo
Handles
<ds:SignedInfo>
elements
This SignedInfo element includes the canonicalization algorithm,
a signature algorithm, and one or more references
- Author:
- Christian Geuer-Pollmann
-
Field Summary
Fields inherited from class org.apache.xml.security.utils.ElementProxy
_baseURI, _constructionElement, _doc, _state, MODE_CREATE, MODE_DECRYPT, MODE_ENCRYPT, MODE_PROCESS, MODE_SIGN, MODE_UNKNOWN, MODE_VERIFY
-
Constructor Summary
ConstructorsConstructorDescriptionSignedInfo
(Document doc) OverwritesManifest.addDocument(java.lang.String, java.lang.String, org.apache.xml.security.transforms.Transforms, java.lang.String, java.lang.String, java.lang.String)
because it creates another Element.SignedInfo
(Document doc, String SignatureMethodURI, int HMACOutputLength, String CanonicalizationMethodURI) Constructor SignedInfoSignedInfo
(Document doc, String SignatureMethodURI, String CanonicalizationMethodURI) ConstructsSignedInfo
using given Canoicaliztion algorithm and Signature algorithmSignedInfo
(Document doc, Element SignatureMethodElem, Element CanonicalizationMethodElem) SignedInfo
(Element element, String BaseURI) Build aSignedInfo
from anElement
-
Method Summary
Modifier and TypeMethodDescriptioncreateSecretKey
(byte[] secretKeyBytes) Creates a SecretKey for the appropriate Mac algorithm based on a byte[] array password.Method getBaseLocalNameReturns the Canonicalization method URIbyte[]
Returns getCanonicalizedOctetStreamMethod getSignatureMethodElementReturns the Signature method URIvoid
Output the C14n stream to the give outputstream.boolean
verify()
Tests core validation processboolean
verify
(boolean followManifests) Tests core validation processMethods inherited from class org.apache.xml.security.signature.Manifest
addDocument, addResourceResolver, addResourceResolver, generateDigestValues, getId, getLength, getReferencedContentAfterTransformsItem, getReferencedContentBeforeTransformsItem, getResolverProperty, getSignedContentItem, getSignedContentLength, getVerificationResult, item, setId, setResolverProperty, verifyReferences, verifyReferences
Methods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, guaranteeThatElementInCorrectSpace, length, setDefaultPrefix, setElement, setXPathNamespaceContext
-
Constructor Details
-
SignedInfo
OverwritesManifest.addDocument(java.lang.String, java.lang.String, org.apache.xml.security.transforms.Transforms, java.lang.String, java.lang.String, java.lang.String)
because it creates another Element.- Parameters:
doc
- theDocument
in whichXMLsignature
will be placed- Throws:
XMLSecurityException
-
SignedInfo
public SignedInfo(Document doc, String SignatureMethodURI, String CanonicalizationMethodURI) throws XMLSecurityException ConstructsSignedInfo
using given Canoicaliztion algorithm and Signature algorithm- Parameters:
doc
-SignedInfo
is placed in this documentSignatureMethodURI
- URI representation of the Digest and Signature algorithmCanonicalizationMethodURI
- URI representation of the Canonicalization method- Throws:
XMLSecurityException
-
SignedInfo
public SignedInfo(Document doc, String SignatureMethodURI, int HMACOutputLength, String CanonicalizationMethodURI) throws XMLSecurityException Constructor SignedInfo- Parameters:
doc
-SignatureMethodURI
-HMACOutputLength
-CanonicalizationMethodURI
-- Throws:
XMLSecurityException
-
SignedInfo
public SignedInfo(Document doc, Element SignatureMethodElem, Element CanonicalizationMethodElem) throws XMLSecurityException - Parameters:
doc
-SignatureMethodElem
-CanonicalizationMethodElem
-- Throws:
XMLSecurityException
-
SignedInfo
Build aSignedInfo
from anElement
- Parameters:
element
-SignedInfo
BaseURI
- the URI of the resource where the XML instance was stored- Throws:
XMLSecurityException
- See Also:
-
-
Method Details
-
verify
Tests core validation process- Returns:
- true if verification was successful
- Throws:
MissingResourceFailureException
XMLSecurityException
-
verify
public boolean verify(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException Tests core validation process- Parameters:
followManifests
- defines whether the verification process has to verify referencedds:Manifest
s, too- Returns:
- true if verification was successful
- Throws:
MissingResourceFailureException
XMLSecurityException
-
getCanonicalizedOctetStream
public byte[] getCanonicalizedOctetStream() throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityExceptionReturns getCanonicalizedOctetStream- Returns:
- the canonicalization result octedt stream of
SignedInfo
element - Throws:
CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
-
signInOctectStream
public void signInOctectStream(OutputStream os) throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException Output the C14n stream to the give outputstream.- Parameters:
os
-- Throws:
CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
-
getCanonicalizationMethodURI
Returns the Canonicalization method URI- Returns:
- the Canonicalization method URI
-
getSignatureMethodURI
Returns the Signature method URI- Returns:
- the Signature method URI
-
getSignatureMethodElement
Method getSignatureMethodElement- Returns:
- gets The SignatureMethod Node.
-
createSecretKey
Creates a SecretKey for the appropriate Mac algorithm based on a byte[] array password.- Parameters:
secretKeyBytes
-- Returns:
- the secret key for the SignedInfo element.
-
getBaseLocalName
Method getBaseLocalName- Overrides:
getBaseLocalName
in classManifest
- Returns:
- the localname of the Elements of the sub-class.
-
getInclusiveNamespaces
-