public class WSSecDKSign extends WSSecDerivedKeyBase
Modifier and Type | Field and Description |
---|---|
protected String |
canonAlgo |
protected String |
sigAlgo |
protected byte[] |
signatureValue |
clientLabel, derivedKeyBytes, derivedKeyLength, dkt, dktId, document, envelope, ephemeralKey, serviceLabel, strElem, tokenIdDirectId, tokenIdentifier
Constructor and Description |
---|
WSSecDKSign() |
Modifier and Type | Method and Description |
---|---|
void |
addReferencesToSign(Vector references,
WSSecHeader secHeader)
This method adds references to the Signature.
|
void |
appendSigToHeader(WSSecHeader secHeader) |
org.w3c.dom.Document |
build(org.w3c.dom.Document doc,
WSSecHeader secHeader) |
void |
computeSignature()
Compute the Signature over the references.
|
protected org.w3c.dom.Element |
createSTRParameter(org.w3c.dom.Document doc) |
protected int |
getDerivedKeyLength()
The derived key will change depending on the sig/encr algorithm.
|
protected Set |
getInclusivePrefixes(org.w3c.dom.Element target) |
protected Set |
getInclusivePrefixes(org.w3c.dom.Element target,
boolean excludeVisible) |
String |
getSigCanonicalization()
Get the canonicalization method.
|
org.w3c.dom.Element |
getSignatureElement()
Returns the signature Element.
|
byte[] |
getSignatureValue() |
void |
prepare(org.w3c.dom.Document doc,
WSSecHeader secHeader) |
void |
prependSigToHeader(WSSecHeader secHeader)
Prepends the Signature element to the elements already in the Security
header.
|
void |
setSigCanonicalization(String algo)
Set the canonicalization method to use.
|
void |
setSignatureAlgorithm(String algo) |
appendDKElementToHeader, getdktElement, getId, getTokenIdentifier, prepare, prependDKElementToHeader, setClientLabel, setCustomValueType, setDerivedKeyLength, setExternalKey, setExternalKey, setServiceLabel, setTokenIdDirectId, setWscVersion
getKeyIdentifierType, setBodyID, setKeyIdentifierType, setParts, setUserInfo, setWsConfig, setWsuId
protected String sigAlgo
protected String canonAlgo
protected byte[] signatureValue
public org.w3c.dom.Document build(org.w3c.dom.Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException
public void prepare(org.w3c.dom.Document doc, WSSecHeader secHeader) throws WSSecurityException, ConversationException
protected Set getInclusivePrefixes(org.w3c.dom.Element target)
protected Set getInclusivePrefixes(org.w3c.dom.Element target, boolean excludeVisible)
public void addReferencesToSign(Vector references, WSSecHeader secHeader) throws WSSecurityException
computeSignature()
. This method can be called several
times to add references as required. addReferencesToSign()
can be called any time after prepare
.references
- A vector containing WSEncryptionPart
objects
that define the parts to sign.secHeader
- Used to compute namespaces to be inserted by
InclusiveNamespaces to be WSI compliant.WSSecurityException
protected org.w3c.dom.Element createSTRParameter(org.w3c.dom.Document doc)
public void prependSigToHeader(WSSecHeader secHeader)
prepare()
.
This allows to insert the Signature element at any position in the
Security header.secHeader
- The secHeader that holds the Signature element.public void appendSigToHeader(WSSecHeader secHeader)
public org.w3c.dom.Element getSignatureElement()
prepare()
.public void computeSignature() throws WSSecurityException
addReferencesToSign()
.WSSecurityException
protected int getDerivedKeyLength() throws WSSecurityException
WSSecDerivedKeyBase
getDerivedKeyLength
in class WSSecDerivedKeyBase
WSSecurityException
WSSecDerivedKeyBase.getDerivedKeyLength()
public void setSignatureAlgorithm(String algo)
public byte[] getSignatureValue()
public void setSigCanonicalization(String algo)
algo
- Is the name of the signature algorithmWSConstants.C14N_OMIT_COMMENTS
,
WSConstants.C14N_WITH_COMMENTS
,
WSConstants.C14N_EXCL_OMIT_COMMENTS
,
WSConstants.C14N_EXCL_WITH_COMMENTS
public String getSigCanonicalization()
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.