APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.signature

public Class SignedInfo

extends Manifest
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.security.Provider, java.security.spec.AlgorithmParameterSpec, javax.crypto.SecretKey, javax.crypto.spec.SecretKeySpec, com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm, com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException, .Canonicalizer, .InvalidCanonicalizerException, com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException, com.sun.org.apache.xml.internal.security.transforms.params.InclusiveNamespaces, com.sun.org.apache.xml.internal.security.utils.Constants, .XMLUtils, org.w3c.dom.Document, .Element

Handles <ds:SignedInfo> elements This SignedInfo element includes the canonicalization algorithm, a signature algorithm, and one or more references.

Field Summary

Modifier and TypeField and Description
private byte[]
c14nizedBytes

Field c14nizedBytes

private Element
private final SignatureAlgorithm
signatureAlgorithm

Field signatureAlgorithm

private Element
Inherited from com.sun.org.apache.xml.internal.security.signature.Manifest:
MAXIMUM_REFERENCE_COUNT

Constructor Summary

AccessConstructor and Description
public
SignedInfo(Document
the Document in which XMLsignature will be placed
doc
)

Overwrites Manifest#addDocument because it creates another Element.

public
SignedInfo(Document
SignedInfo is placed in this document
doc
,
String
URI representation of the Digest and Signature algorithm
signatureMethodURI
,
String
URI representation of the Canonicalization method
canonicalizationMethodURI
)

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

public
SignedInfo(Document
SignedInfo is placed in this document
doc
,
String
URI representation of the Digest and Signature algorithm
signatureMethodURI
,
String
URI representation of the Canonicalization method
canonicalizationMethodURI
,
Provider
security provider to use
provider
)

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

public
SignedInfo(Document
SignedInfo is placed in this document
doc
,
String
URI representation of the Digest and Signature algorithm
signatureMethodURI
,
int hMACOutputLength, String
URI representation of the Canonicalization method
canonicalizationMethodURI
)

Constructor SignedInfo

public
SignedInfo(Document
SignedInfo is placed in this document
doc
,
String
URI representation of the Digest and Signature algorithm
signatureMethodURI
,
int hMACOutputLength, String
URI representation of the Canonicalization method
canonicalizationMethodURI
,
Provider
security provider to use
provider
,
AlgorithmParameterSpec
AlgorithmParameterSpec to use
spec
)

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

public
SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem)

public
SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem, Provider provider)

public
SignedInfo(Element
SignedInfo
element
,
String
the URI of the resource where the XML instance was stored
baseURI
)

Build a SignedInfo from an Element

public
SignedInfo(Element
SignedInfo
element
,
String
the URI of the resource where the XML instance was stored
baseURI
,
boolean
whether secure validation is enabled or not
secureValidation
)

Build a SignedInfo from an Element

public
SignedInfo(Element
SignedInfo
element
,
String
the URI of the resource where the XML instance was stored
baseURI
,
boolean
whether secure validation is enabled or not
secureValidation
,
Provider
security provider to use
provider
)

Build a SignedInfo from an Element

Method Summary

Modifier and TypeMethod and Description
public SecretKey

Returns:

the secret key for the SignedInfo element.
createSecretKey
(byte[] secretKeyBytes)

Creates a SecretKey for the appropriate Mac algorithm based on a byte[] array password.

public String
getBaseLocalName()

Overrides com.sun.org.apache.xml.internal.security.signature.Manifest.getBaseLocalName.

Method getBaseLocalName Method getBaseLocalName Returns the localname of the Elements of the sub-class.

public String

Returns:

the Canonicalization method URI
getCanonicalizationMethodURI
()

Returns the Canonicalization method URI

public byte[]

Returns:

the canonicalization result octet stream of SignedInfo element
getCanonicalizedOctetStream
()

Returns getCanonicalizedOctetStream

public String
public SignatureAlgorithm
public Element

Returns:

returns the SignatureMethod Element
getSignatureMethodElement
()

Method getSignatureMethodElement

public String

Returns:

the Signature method URI
getSignatureMethodURI
()

Returns the Signature method URI

public void
signInOctetStream(OutputStream os)

Output the C14n stream to the given OutputStream.

public boolean

Returns:

true if verification was successful
verify
()

Tests core validation process

public boolean

Returns:

true if verification was successful
verify
(boolean
defines whether the verification process has to verify referenced ds:Manifests, too
followManifests
)

Tests core validation process

Inherited from com.sun.org.apache.xml.internal.security.signature.Manifest:
addDocumentaddResourceResolvergenerateDigestValuesgetIdgetLengthgetPerManifestResolversgetReferencedContentAfterTransformsItemgetReferencedContentBeforeTransformsItemgetResolverPropertiesgetResolverPropertygetSignedContentItemgetSignedContentLengthgetVerificationResultgetVerificationResultsisSecureValidationitemsetIdsetResolverPropertyverifyReferencesverifyReferences

Field Detail

c14nizedBytesback to summary
private byte[] c14nizedBytes

Field c14nizedBytes

c14nMethodback to summary
private Element c14nMethod
signatureAlgorithmback to summary
private final SignatureAlgorithm signatureAlgorithm

Field signatureAlgorithm

signatureMethodback to summary
private Element signatureMethod

Constructor Detail

SignedInfoback to summary
public SignedInfo(Document doc) throws XMLSecurityException

Overwrites Manifest#addDocument because it creates another Element.

Parameters
doc:Document

the Document in which XMLsignature will be placed

SignedInfoback to summary
public SignedInfo(Document doc, String signatureMethodURI, String canonicalizationMethodURI) throws XMLSecurityException

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

Parameters
doc:Document

SignedInfo is placed in this document

signatureMethodURI:String

URI representation of the Digest and Signature algorithm

canonicalizationMethodURI:String

URI representation of the Canonicalization method

SignedInfoback to summary
public SignedInfo(Document doc, String signatureMethodURI, String canonicalizationMethodURI, Provider provider) throws XMLSecurityException

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

Parameters
doc:Document

SignedInfo is placed in this document

signatureMethodURI:String

URI representation of the Digest and Signature algorithm

canonicalizationMethodURI:String

URI representation of the Canonicalization method

provider:Provider

security provider to use

SignedInfoback to summary
public SignedInfo(Document doc, String signatureMethodURI, int hMACOutputLength, String canonicalizationMethodURI) throws XMLSecurityException

Constructor SignedInfo

Parameters
doc:Document

SignedInfo is placed in this document

signatureMethodURI:String

URI representation of the Digest and Signature algorithm

canonicalizationMethodURI:String

URI representation of the Canonicalization method

SignedInfoback to summary
public SignedInfo(Document doc, String signatureMethodURI, int hMACOutputLength, String canonicalizationMethodURI, Provider provider, AlgorithmParameterSpec spec) throws XMLSecurityException

Constructs SignedInfo using given Canonicalization algorithm and Signature algorithm.

Parameters
doc:Document

SignedInfo is placed in this document

signatureMethodURI:String

URI representation of the Digest and Signature algorithm

canonicalizationMethodURI:String

URI representation of the Canonicalization method

provider:Provider

security provider to use

spec:AlgorithmParameterSpec

AlgorithmParameterSpec to use

SignedInfoback to summary
public SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem) throws XMLSecurityException
SignedInfoback to summary
public SignedInfo(Document doc, Element signatureMethodElem, Element canonicalizationMethodElem, Provider provider) throws XMLSecurityException
SignedInfoback to summary
public SignedInfo(Element element, String baseURI) throws XMLSecurityException

Build a SignedInfo from an Element

Parameters
element:Element

SignedInfo

baseURI:String

the URI of the resource where the XML instance was stored

See Also
Question, Answer
SignedInfoback to summary
public SignedInfo(Element element, String baseURI, boolean secureValidation) throws XMLSecurityException

Build a SignedInfo from an Element

Parameters
element:Element

SignedInfo

baseURI:String

the URI of the resource where the XML instance was stored

secureValidation:boolean

whether secure validation is enabled or not

See Also
Question, Answer
SignedInfoback to summary
public SignedInfo(Element element, String baseURI, boolean secureValidation, Provider provider) throws XMLSecurityException

Build a SignedInfo from an Element

Parameters
element:Element

SignedInfo

baseURI:String

the URI of the resource where the XML instance was stored

secureValidation:boolean

whether secure validation is enabled or not

provider:Provider

security provider to use

See Also
Question, Answer

Method Detail

createSecretKeyback to summary
public SecretKey createSecretKey(byte[] secretKeyBytes)

Creates a SecretKey for the appropriate Mac algorithm based on a byte[] array password.

Returns:SecretKey

the secret key for the SignedInfo element.

getBaseLocalNameback to summary
public String getBaseLocalName()

Overrides com.sun.org.apache.xml.internal.security.signature.Manifest.getBaseLocalName.

Doc from com.sun.org.apache.xml.internal.security.signature.Manifest.getBaseLocalName.

Method getBaseLocalName Method getBaseLocalName Returns the localname of the Elements of the sub-class.

Annotations
@Override
getCanonicalizationMethodURIback to summary
public String getCanonicalizationMethodURI()

Returns the Canonicalization method URI

Returns:String

the Canonicalization method URI

getCanonicalizedOctetStreamback to summary
public byte[] getCanonicalizedOctetStream() throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException, IOException

Returns getCanonicalizedOctetStream

Returns:byte[]

the canonicalization result octet stream of SignedInfo element

getInclusiveNamespacesback to summary
public String getInclusiveNamespaces()
getSignatureAlgorithmback to summary
public SignatureAlgorithm getSignatureAlgorithm()
getSignatureMethodElementback to summary
public Element getSignatureMethodElement()

Method getSignatureMethodElement

Returns:Element

returns the SignatureMethod Element

getSignatureMethodURIback to summary
public String getSignatureMethodURI()

Returns the Signature method URI

Returns:String

the Signature method URI

signInOctetStreamback to summary
public void signInOctetStream(OutputStream os) throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException

Output the C14n stream to the given OutputStream.

verifyback to summary
public boolean verify() throws MissingResourceFailureException, XMLSecurityException

Tests core validation process

Returns:boolean

true if verification was successful

verifyback to summary
public boolean verify(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException

Tests core validation process

Parameters
followManifests:boolean

defines whether the verification process has to verify referenced ds:Manifests, too

Returns:boolean

true if verification was successful