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
Fields inherited from class org.apache.xml.security.signature.Manifest
MAXIMUM_REFERENCE_COUNTFields 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) ConstructsSignedInfousing given Canonicalization algorithm and Signature algorithm.SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem) SignedInfo(Element element, String baseURI) Build aSignedInfofrom anElementSignedInfo(Element element, String baseURI, boolean secureValidation) Build aSignedInfofrom 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 URIvoidOutput the C14n stream to the given OutputStream.booleanverify()Tests core validation processbooleanverify(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, verifyReferencesMethods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespaceMethods 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
-
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- theDocumentin whichXMLsignaturewill be placed- Throws:
XMLSecurityException
-
SignedInfo
public SignedInfo(Document doc, String signatureMethodURI, String canonicalizationMethodURI) throws XMLSecurityException ConstructsSignedInfousing given Canonicalization algorithm and Signature algorithm.- Parameters:
doc-SignedInfois 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-SignedInfois 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 aSignedInfofrom anElement- Parameters:
element-SignedInfobaseURI- 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 aSignedInfofrom anElement- Parameters:
element-SignedInfobaseURI- the URI of the resource where the XML instance was storedsecureValidation- whether secure validation is enabled or not- Throws:
XMLSecurityException- See Also:
-
-
Method Details
-
verify
Tests core validation process- Returns:
- true if verification was successful
- Throws:
MissingResourceFailureExceptionXMLSecurityException
-
verify
public boolean verify(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException Tests core validation process- Parameters:
followManifests- defines whether the verification process has to verify referencedds:Manifests, too- Returns:
- true if verification was successful
- Throws:
MissingResourceFailureExceptionXMLSecurityException
-
getCanonicalizedOctetStream
public byte[] getCanonicalizedOctetStream() throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityExceptionReturns getCanonicalizedOctetStream- Returns:
- the canonicalization result octet stream of
SignedInfoelement - Throws:
CanonicalizationExceptionInvalidCanonicalizerExceptionXMLSecurityException
-
signInOctetStream
public void signInOctetStream(OutputStream os) throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException Output the C14n stream to the given OutputStream.- Parameters:
os-- Throws:
CanonicalizationExceptionInvalidCanonicalizerExceptionXMLSecurityException
-
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:
getBaseLocalNamein classManifest- Returns:
- the localname of the Elements of the sub-class.
-
getInclusiveNamespaces
-