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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
Field c14nizedBytesprivate Element
private SignatureAlgorithm
Field signatureAlgorithmprivate Element
Fields inherited from class org.apache.xml.security.signature.Manifest
MAXIMUM_REFERENCE_COUNT
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI
-
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 Canonicalization algorithm and Signature algorithm.SignedInfo
(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem) SignedInfo
(Element element, String baseURI) Build aSignedInfo
from anElement
SignedInfo
(Element element, String baseURI, boolean secureValidation) 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 getBaseLocalName Method getBaseLocalName Returns the localname of the Elements of the sub-class.Returns the Canonicalization method URIbyte[]
Returns getCanonicalizedOctetStreamMethod getSignatureMethodElementReturns the Signature method URIprivate static Element
reparseSignedInfoElem
(Element element, boolean secureValidation) void
Output the C14n stream to the given 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, getPerManifestResolvers, getReferencedContentAfterTransformsItem, getReferencedContentBeforeTransformsItem, getResolverProperties, getResolverProperty, getSignedContentItem, getSignedContentLength, getVerificationResult, getVerificationResults, isSecureValidation, 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, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
-
Field Details
-
signatureAlgorithm
Field signatureAlgorithm -
c14nizedBytes
private byte[] c14nizedBytesField c14nizedBytes -
c14nMethod
-
signatureMethod
-
-
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 Canonicalization 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
-SignedInfo
is placed in this documentsignatureMethodURI
- URI representation of the Digest and Signature algorithmhMACOutputLength
-canonicalizationMethodURI
- URI representation of the Canonicalization method- 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:
-
SignedInfo
public SignedInfo(Element element, String baseURI, boolean secureValidation) throws XMLSecurityException Build aSignedInfo
from anElement
- Parameters:
element
-SignedInfo
baseURI
- the URI of the resource where the XML instance was storedsecureValidation
- whether secure validation is enabled or not- Throws:
XMLSecurityException
- See Also:
-
-
Method Details
-
reparseSignedInfoElem
private static Element reparseSignedInfoElem(Element element, boolean secureValidation) throws XMLSecurityException - Throws:
XMLSecurityException
-
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 octet stream of
SignedInfo
element - Throws:
CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
-
signInOctetStream
public void signInOctetStream(OutputStream os) throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException Output the C14n stream to the given 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:
- returns the SignatureMethod Element
-
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.
-
getSignatureAlgorithm
-
getBaseLocalName
Method getBaseLocalName Method getBaseLocalName Returns the localname of the Elements of the sub-class.- Overrides:
getBaseLocalName
in classManifest
- Returns:
- the localname of the Elements of the sub-class.
-
getInclusiveNamespaces
-