org.opensaml.xml.signature.impl
Class SignatureImpl

java.lang.Object
  extended by org.opensaml.xml.AbstractXMLObject
      extended by org.opensaml.xml.signature.impl.SignatureImpl
All Implemented Interfaces:
Signature, XMLObject

public class SignatureImpl
extends AbstractXMLObject
implements Signature

XMLObject representing an enveloped or detached XML Digital Signature, version 20020212, Signature element.


Field Summary
private  String canonicalizationAlgorithm
          Canonicalization algorithm used in signature.
private  List<ContentReference> contentReferences
          References to content to be signed.
private  Integer hmacOutputLength
          Optional HMAC output length parameter to the signature algorithm.
private  KeyInfo keyInfo
          Public key information to embed in the signature.
private  String signatureAlgorithm
          Algorithm used to generate the signature.
private  Credential signingCredential
          Key used to sign the signature.
private  org.apache.xml.security.signature.XMLSignature xmlSignature
          Constructed Apache XML Security signature object.
 
Fields inherited from interface org.opensaml.xml.signature.Signature
DEFAULT_ELEMENT_LOCAL_NAME, DEFAULT_ELEMENT_NAME, TYPE_LOCAL_NAME, TYPE_NAME
 
Constructor Summary
protected SignatureImpl(String namespaceURI, String elementLocalName, String namespacePrefix)
          Constructor.
 
Method Summary
 String getCanonicalizationAlgorithm()
          Gets the canonicalization algorithm used to create the signature content.
 List<ContentReference> getContentReferences()
          Gets the list of signature content references.
 Integer getHMACOutputLength()
          Gets the HMAC output length value, optionally used when signing with an HMAC signature algorithm.
 KeyInfo getKeyInfo()
          Gets the key info added to this signature.
 List<XMLObject> getOrderedChildren()
          Gets an unmodifiable list of child elements in the order that they will appear in the DOM.
 String getSignatureAlgorithm()
          Gets the algorithm used to compute the signature.
 Credential getSigningCredential()
          Gets the signature signing credential.
 org.apache.xml.security.signature.XMLSignature getXMLSignature()
          Get the Apache XML Security signature instance held by this object.
 void releaseDOM()
          Releases the DOM representation of this XMLObject, if there is one.
 void setCanonicalizationAlgorithm(String newAlgorithm)
          Sets the canonicalization algorithm used to create the signature content.
 void setHMACOutputLength(Integer length)
          Sets the HMAC output length value, optionally used when signing with an HMAC signature algorithm.
 void setKeyInfo(KeyInfo newKeyInfo)
          Sets the key info added to this signature.
 void setSignatureAlgorithm(String newAlgorithm)
          Sets the algorithm used to compute the signature.
 void setSigningCredential(Credential newCredential)
          Sets the signature signing credential.
 void setXMLSignature(org.apache.xml.security.signature.XMLSignature signature)
          Set the Apache XML Security signature instance held by this object.
 
Methods inherited from class org.opensaml.xml.AbstractXMLObject
addNamespace, detach, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, manageQualifiedAttributeNamespace, prepareAttributeValueForAssignment, prepareElementContentForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, registerOwnID, releaseChildrenDOM, releaseParentDOM, releaseThisAndChildrenDOM, releaseThisandParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setElementNamespacePrefix, setElementQName, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation, setSchemaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.xml.XMLObject
addNamespace, detach, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, releaseChildrenDOM, releaseParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation
 

Field Detail

canonicalizationAlgorithm

private String canonicalizationAlgorithm
Canonicalization algorithm used in signature.


signatureAlgorithm

private String signatureAlgorithm
Algorithm used to generate the signature.


hmacOutputLength

private Integer hmacOutputLength
Optional HMAC output length parameter to the signature algorithm.


signingCredential

private Credential signingCredential
Key used to sign the signature.


keyInfo

private KeyInfo keyInfo
Public key information to embed in the signature.


contentReferences

private List<ContentReference> contentReferences
References to content to be signed.


xmlSignature

private org.apache.xml.security.signature.XMLSignature xmlSignature
Constructed Apache XML Security signature object.

Constructor Detail

SignatureImpl

protected SignatureImpl(String namespaceURI,
                        String elementLocalName,
                        String namespacePrefix)
Constructor.

Parameters:
namespaceURI - the namespace the element is in
elementLocalName - the local name of the XML element this Object represents
namespacePrefix - the prefix for the given namespace
Method Detail

getCanonicalizationAlgorithm

public String getCanonicalizationAlgorithm()
Gets the canonicalization algorithm used to create the signature content.

Specified by:
getCanonicalizationAlgorithm in interface Signature
Returns:
the canonicalization algorithm used to create the signature content

setCanonicalizationAlgorithm

public void setCanonicalizationAlgorithm(String newAlgorithm)
Sets the canonicalization algorithm used to create the signature content.

Specified by:
setCanonicalizationAlgorithm in interface Signature
Parameters:
newAlgorithm - the canonicalization algorithm used to create the signature content

getSignatureAlgorithm

public String getSignatureAlgorithm()
Gets the algorithm used to compute the signature.

Specified by:
getSignatureAlgorithm in interface Signature
Returns:
the algorithm used to compute the signature

setSignatureAlgorithm

public void setSignatureAlgorithm(String newAlgorithm)
Sets the algorithm used to compute the signature.

Specified by:
setSignatureAlgorithm in interface Signature
Parameters:
newAlgorithm - the algorithm used to compute the signature

getHMACOutputLength

public Integer getHMACOutputLength()
Gets the HMAC output length value, optionally used when signing with an HMAC signature algorithm.

Specified by:
getHMACOutputLength in interface Signature
Returns:
the HMACOutputLength value

setHMACOutputLength

public void setHMACOutputLength(Integer length)
Sets the HMAC output length value, optionally used when signing with an HMAC signature algorithm.

Specified by:
setHMACOutputLength in interface Signature
Parameters:
length - the new HMACOutputLength value

getSigningCredential

public Credential getSigningCredential()
Gets the signature signing credential.

Specified by:
getSigningCredential in interface Signature
Returns:
the signature signing credential

setSigningCredential

public void setSigningCredential(Credential newCredential)
Sets the signature signing credential.

Specified by:
setSigningCredential in interface Signature
Parameters:
newCredential - the signature signing credential

getKeyInfo

public KeyInfo getKeyInfo()
Gets the key info added to this signature.

Specified by:
getKeyInfo in interface Signature
Returns:
the key info added to this signature

setKeyInfo

public void setKeyInfo(KeyInfo newKeyInfo)
Sets the key info added to this signature.

Specified by:
setKeyInfo in interface Signature
Parameters:
newKeyInfo - the key info added to this signature

getContentReferences

public List<ContentReference> getContentReferences()
Gets the list of signature content references.

Specified by:
getContentReferences in interface Signature
Returns:
the list of signature content references

getOrderedChildren

public List<XMLObject> getOrderedChildren()
Gets an unmodifiable list of child elements in the order that they will appear in the DOM.

Specified by:
getOrderedChildren in interface XMLObject
Returns:
ordered list of child elements

releaseDOM

public void releaseDOM()
Releases the DOM representation of this XMLObject, if there is one.

Specified by:
releaseDOM in interface XMLObject
Overrides:
releaseDOM in class AbstractXMLObject

getXMLSignature

public org.apache.xml.security.signature.XMLSignature getXMLSignature()
Get the Apache XML Security signature instance held by this object.

Returns:
an Apache XML Security signature object

setXMLSignature

public void setXMLSignature(org.apache.xml.security.signature.XMLSignature signature)
Set the Apache XML Security signature instance held by this object.

Parameters:
signature - an Apache XML Security signature object


Copyright © 1999-2013. All Rights Reserved.