org.apache.xml.security.signature
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
public class SignedInfo
- extends Manifest
Handles <ds:SignedInfo>
elements
This SignedInfo element includes the canonicalization algorithm,
a signature algorithm, and one or more references.
- Author:
- Christian Geuer-Pollmann
Constructor Summary |
SignedInfo(org.w3c.dom.Document doc)
Overwrites Manifest.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(org.w3c.dom.Document doc,
org.w3c.dom.Element signatureMethodElem,
org.w3c.dom.Element canonicalizationMethodElem)
|
SignedInfo(org.w3c.dom.Document doc,
java.lang.String signatureMethodURI,
int hMACOutputLength,
java.lang.String canonicalizationMethodURI)
Constructor SignedInfo |
SignedInfo(org.w3c.dom.Document doc,
java.lang.String signatureMethodURI,
java.lang.String canonicalizationMethodURI)
Constructs SignedInfo using given Canonicalization algorithm and
Signature algorithm. |
SignedInfo(org.w3c.dom.Element element,
java.lang.String baseURI)
Build a SignedInfo from an Element |
Methods 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.ElementProxy |
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, createElementForFamilyLocal, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDefaultPrefixBindings, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, length, setDefaultPrefix, setElement, setXPathNamespaceContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SignedInfo
public SignedInfo(org.w3c.dom.Document doc)
throws XMLSecurityException
- Overwrites
Manifest.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
- the Document
in which XMLsignature
will
be placed
- Throws:
XMLSecurityException
SignedInfo
public SignedInfo(org.w3c.dom.Document doc,
java.lang.String signatureMethodURI,
java.lang.String canonicalizationMethodURI)
throws XMLSecurityException
- Constructs
SignedInfo
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(org.w3c.dom.Document doc,
java.lang.String signatureMethodURI,
int hMACOutputLength,
java.lang.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(org.w3c.dom.Document doc,
org.w3c.dom.Element signatureMethodElem,
org.w3c.dom.Element canonicalizationMethodElem)
throws XMLSecurityException
- Parameters:
doc
- signatureMethodElem
- canonicalizationMethodElem
-
- Throws:
XMLSecurityException
SignedInfo
public SignedInfo(org.w3c.dom.Element element,
java.lang.String baseURI)
throws XMLSecurityException
- Build a
SignedInfo
from an Element
- Parameters:
element
- SignedInfo
baseURI
- the URI of the resource where the XML instance was stored
- Throws:
XMLSecurityException
- See Also:
- Question,
Answer
verify
public boolean verify()
throws MissingResourceFailureException,
XMLSecurityException
- 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 referenced ds:Manifest
s, too
- Returns:
- true if verification was successful
- Throws:
MissingResourceFailureException
XMLSecurityException
getCanonicalizedOctetStream
public byte[] getCanonicalizedOctetStream()
throws CanonicalizationException,
InvalidCanonicalizerException,
XMLSecurityException
- Returns getCanonicalizedOctetStream
- Returns:
- the canonicalization result octet stream of
SignedInfo
element
- Throws:
CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
signInOctectStream
public void signInOctectStream(java.io.OutputStream os)
throws CanonicalizationException,
InvalidCanonicalizerException,
XMLSecurityException
- Output the C14n stream to the given OutputStream.
- Parameters:
os
-
- Throws:
CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
getCanonicalizationMethodURI
public java.lang.String getCanonicalizationMethodURI()
- Returns the Canonicalization method URI
- Returns:
- the Canonicalization method URI
getSignatureMethodURI
public java.lang.String getSignatureMethodURI()
- Returns the Signature method URI
- Returns:
- the Signature method URI
getSignatureMethodElement
public org.w3c.dom.Element getSignatureMethodElement()
- Method getSignatureMethodElement
- Returns:
- returns the SignatureMethod Element
createSecretKey
public javax.crypto.SecretKey createSecretKey(byte[] secretKeyBytes)
- 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
protected SignatureAlgorithm getSignatureAlgorithm()
getBaseLocalName
public java.lang.String getBaseLocalName()
- Method getBaseLocalName
- Overrides:
getBaseLocalName
in class Manifest
- Returns:
- the localname of the Elements of the sub-class.
getInclusiveNamespaces
public java.lang.String getInclusiveNamespaces()
Copyright © 2000-2014 The Apache Software Foundation. All Rights Reserved.