|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensaml.SAMLObject
org.opensaml.SAMLSignedObject
public abstract class SAMLSignedObject
Abstract base class for all SAML objects that can be signed
Field Summary |
---|
Fields inherited from class org.opensaml.SAMLObject |
---|
config, dirty, log, parentObject, root |
Constructor Summary | |
---|---|
SAMLSignedObject()
|
Method Summary | |
---|---|
protected Object |
clone()
Copies a SAML object such that no dependencies exist between the original and the copy. |
void |
fromDOM(Element e)
Initialization of an object from a DOM element |
String |
getDigestAlgorithm()
Returns the digest algorithm identifier from the signature |
abstract String |
getId()
Gets the ID of the signed object |
Object |
getNativeSignature()
Debugging aid to access the internal XML Signature implementation |
String |
getSignatureAlgorithm()
Returns the signing algorithm identifier from the signature |
protected Element |
getSignatureElement()
Get the DOM element containing the signature |
Iterator |
getX509Certificates()
Returns an iterator over the X.509 certificates included in the signature, if any |
protected abstract void |
insertSignature()
Places the signature into the object's DOM to prepare for signing |
boolean |
isSigned()
Returns true iff the object contains a signature |
protected void |
setDirty(boolean flag)
Sets or clears the object's dirty bit. |
void |
sign(String sigalg,
Key k,
Collection certs)
Sign the SAML object according to the input parameters, using a default digest algorithm. |
void |
sign(String sigalg,
String digalg,
Key k,
Collection certs)
Sign the SAML object according to the input parameters |
Node |
toDOM(boolean xmlns)
Transforms the object into a DOM tree without an existing document context |
void |
unsign()
Remove the signature and turn this into an unsigned object. |
void |
verify()
Verifies the signature using only the keying material included within it |
void |
verify(Certificate cert)
Verifies the signature using the keying material provided |
void |
verify(Key k)
Verifies the signature using the keying material provided |
Methods inherited from class org.opensaml.SAMLObject |
---|
buildRoot, checkValidity, fromStream, fromStream, getParent, plantRoot, setParent, toBase64, toDOM, toDOM, toDOM, toStream, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SAMLSignedObject()
Method Detail |
---|
public Object getNativeSignature()
public abstract String getId()
public void fromDOM(Element e) throws SAMLException
SAMLObject
fromDOM
in class SAMLObject
e
- Root element of a DOM tree
SAMLException
- Raised if an exception occurs while constructing
the objectSAMLObject.fromDOM(Element e)
public Node toDOM(boolean xmlns) throws SAMLException
SAMLObject
toDOM
in class SAMLObject
xmlns
- Include namespace(s) on root element?
SAMLException
- Raised if the object is incompletely definedSAMLObject.toDOM(boolean xmlns)
protected abstract void insertSignature() throws SAMLException
Must be overridden by subclass that knows where to place it
SAMLException
- Thrown if an error occurs while placing the signatureprotected Element getSignatureElement()
protected void setDirty(boolean flag)
SAMLObject
setDirty
in class SAMLObject
flag
- The new value of the dirty bitorg.opensaml.SAMLObject#setDirty()
public void unsign()
public void sign(String sigalg, Key k, Collection certs) throws SAMLException
sigalg
- The XML signature algorithm to applyk
- The secret or private key to sign the resulting digestcerts
- The public key certificate(s) to embed in the object, if any
SAMLException
- Thrown if an error occurs while constructing the signaturepublic void sign(String sigalg, String digalg, Key k, Collection certs) throws SAMLException
sigalg
- The XML signature algorithm to applydigalg
- The digest algorithm to applyk
- The secret or private key to sign the resulting digestcerts
- The public key certificate(s) to embed in the object, if any
SAMLException
- Thrown if an error occurs while constructing the signaturepublic void verify() throws SAMLException
SAMLException
- Thrown if the signature is invalid or if an error occurspublic void verify(Certificate cert) throws SAMLException
cert
- A public key certificate to use in verifying the signature
SAMLException
- Thrown if the signature is invalid or if an error occurspublic void verify(Key k) throws SAMLException
k
- A secret or public key to use in verifying the signature
SAMLException
- Thrown if the signature is invalid or if an error occurspublic Iterator getX509Certificates() throws SAMLException
SAMLException
- Thrown if the signature is missingpublic String getSignatureAlgorithm() throws SAMLException
SAMLException
- Thrown if the signature is missingpublic String getDigestAlgorithm() throws SAMLException
SAMLException
- Thrown if the signature is missingpublic boolean isSigned()
protected Object clone() throws CloneNotSupportedException
clone
in class SAMLObject
CloneNotSupportedException
Object.clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |