public class SignedInfo extends Manifest
<ds:SignedInfo>
elements
This SignedInfo
element includes the canonicalization algorithm,
a signature algorithm, and one or more references.MAXIMUM_REFERENCE_COUNT
baseURI
Constructor and Description |
---|
SignedInfo(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(Document doc,
Element signatureMethodElem,
Element canonicalizationMethodElem) |
SignedInfo(Document doc,
Element signatureMethodElem,
Element canonicalizationMethodElem,
Provider provider) |
SignedInfo(Document doc,
String signatureMethodURI,
int hMACOutputLength,
String canonicalizationMethodURI)
Constructor SignedInfo
|
SignedInfo(Document doc,
String signatureMethodURI,
int hMACOutputLength,
String canonicalizationMethodURI,
Provider provider,
AlgorithmParameterSpec spec)
Constructs
SignedInfo using given Canonicalization algorithm and
Signature algorithm. |
SignedInfo(Document doc,
String signatureMethodURI,
String canonicalizationMethodURI)
Constructs
SignedInfo using given Canonicalization algorithm and
Signature algorithm. |
SignedInfo(Document doc,
String signatureMethodURI,
String canonicalizationMethodURI,
Provider provider)
Constructs
SignedInfo using given Canonicalization algorithm and
Signature algorithm. |
SignedInfo(Element element,
String baseURI)
Build a
SignedInfo from an Element |
SignedInfo(Element element,
String baseURI,
boolean secureValidation)
Build a
SignedInfo from an Element |
SignedInfo(Element element,
String baseURI,
boolean secureValidation,
Provider provider)
Build a
SignedInfo from an Element |
Modifier and Type | Method and Description |
---|---|
SecretKey |
createSecretKey(byte[] secretKeyBytes)
Creates a SecretKey for the appropriate Mac algorithm based on a
byte[] array password.
|
String |
getBaseLocalName()
Method getBaseLocalName
Method getBaseLocalName
Returns the localname of the Elements of the sub-class.
|
String |
getCanonicalizationMethodURI()
Returns the Canonicalization method URI
|
byte[] |
getCanonicalizedOctetStream()
Returns getCanonicalizedOctetStream
|
String |
getInclusiveNamespaces() |
SignatureAlgorithm |
getSignatureAlgorithm() |
Element |
getSignatureMethodElement()
Method getSignatureMethodElement
|
String |
getSignatureMethodURI()
Returns the Signature method URI
|
void |
signInOctetStream(OutputStream os)
Output the C14n stream to the given OutputStream.
|
boolean |
verify()
Tests core validation process
|
boolean |
verify(boolean followManifests)
Tests core validation process
|
addDocument, addResourceResolver, generateDigestValues, getId, getLength, getPerManifestResolvers, getReferencedContentAfterTransformsItem, getReferencedContentBeforeTransformsItem, getResolverProperties, getResolverProperty, getSignedContentItem, getSignedContentLength, getVerificationResult, getVerificationResults, isSecureValidation, item, setId, setResolverProperty, verifyReferences, verifyReferences
getBaseNamespace
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
public SignedInfo(Document doc) throws XMLSecurityException
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.doc
- the Document
in which XMLsignature
will
be placedXMLSecurityException
public SignedInfo(Document doc, String signatureMethodURI, String canonicalizationMethodURI) throws XMLSecurityException
SignedInfo
using given Canonicalization algorithm and
Signature algorithm.doc
- SignedInfo
is placed in this documentsignatureMethodURI
- URI representation of the Digest and
Signature algorithmcanonicalizationMethodURI
- URI representation of the
Canonicalization methodXMLSecurityException
public SignedInfo(Document doc, String signatureMethodURI, String canonicalizationMethodURI, Provider provider) throws XMLSecurityException
SignedInfo
using given Canonicalization algorithm and
Signature algorithm.doc
- SignedInfo
is placed in this documentsignatureMethodURI
- URI representation of the Digest and
Signature algorithmcanonicalizationMethodURI
- URI representation of the
Canonicalization methodprovider
- security provider to useXMLSecurityException
public SignedInfo(Document doc, String signatureMethodURI, int hMACOutputLength, String canonicalizationMethodURI) throws XMLSecurityException
doc
- SignedInfo
is placed in this documentsignatureMethodURI
- URI representation of the Digest and
Signature algorithmhMACOutputLength
- canonicalizationMethodURI
- URI representation of the
Canonicalization methodXMLSecurityException
public SignedInfo(Document doc, String signatureMethodURI, int hMACOutputLength, String canonicalizationMethodURI, Provider provider, AlgorithmParameterSpec spec) throws XMLSecurityException
SignedInfo
using given Canonicalization algorithm and
Signature algorithm.doc
- SignedInfo
is placed in this documentsignatureMethodURI
- URI representation of the Digest and
Signature algorithmhMACOutputLength
- canonicalizationMethodURI
- URI representation of the
Canonicalization methodprovider
- security provider to usespec
- AlgorithmParameterSpec to useXMLSecurityException
public SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem) throws XMLSecurityException
doc
- signatureMethodElem
- canonicalizationMethodElem
- XMLSecurityException
public SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem, Provider provider) throws XMLSecurityException
XMLSecurityException
public SignedInfo(Element element, String baseURI) throws XMLSecurityException
SignedInfo
from an Element
element
- SignedInfo
baseURI
- the URI of the resource where the XML instance was storedXMLSecurityException
public SignedInfo(Element element, String baseURI, boolean secureValidation) throws XMLSecurityException
SignedInfo
from an Element
element
- SignedInfo
baseURI
- the URI of the resource where the XML instance was storedsecureValidation
- whether secure validation is enabled or notXMLSecurityException
public SignedInfo(Element element, String baseURI, boolean secureValidation, Provider provider) throws XMLSecurityException
SignedInfo
from an Element
element
- SignedInfo
baseURI
- the URI of the resource where the XML instance was storedsecureValidation
- whether secure validation is enabled or notprovider
- security provider to useXMLSecurityException
public boolean verify() throws MissingResourceFailureException, XMLSecurityException
MissingResourceFailureException
XMLSecurityException
public boolean verify(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException
followManifests
- defines whether the verification process has to verify referenced ds:Manifest
s, tooMissingResourceFailureException
XMLSecurityException
public byte[] getCanonicalizedOctetStream() throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException, IOException
SignedInfo
elementCanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
IOException
public void signInOctetStream(OutputStream os) throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException
os
- CanonicalizationException
InvalidCanonicalizerException
XMLSecurityException
public String getCanonicalizationMethodURI()
public String getSignatureMethodURI()
public Element getSignatureMethodElement()
public SecretKey createSecretKey(byte[] secretKeyBytes)
secretKeyBytes
- public SignatureAlgorithm getSignatureAlgorithm()
public String getBaseLocalName()
getBaseLocalName
in class Manifest
public String getInclusiveNamespaces()
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.