public class LibDSigUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static XSSignature |
addSignature(oracle.security.xmlsec.util.XMLElement msg,
java.lang.String referenceTargetID,
java.lang.String signatureMethod,
java.lang.String c14nMethod,
java.lang.String digestMethod,
java.lang.String[] nsURIs,
java.lang.String[] localNames)
Creates a new XML-DSIG
Signature element and inserts
it into the given message, replacing any exisiting XML-DSIG
Signature element. |
static java.lang.String |
signURL(java.lang.String msg,
java.security.PrivateKey key,
java.lang.String sigAlgURI)
Computes a signature over the given message, using the given
private key and signature algorithm, and returns a URL-encoded
string suitable for use as a URL query parameter.
|
public static XSSignature addSignature(oracle.security.xmlsec.util.XMLElement msg, java.lang.String referenceTargetID, java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod, java.lang.String[] nsURIs, java.lang.String[] localNames)
Signature
element and inserts
it into the given message, replacing any exisiting XML-DSIG
Signature
element. This method does not compute
the SignatureValue
or create the KeyInfo
child element for the Signature
element.
Note: The SHA-1 algorithm is used for the Reference's DigestMethod.
msg
- The message the Signature element to be added on.referenceTargetID
- The ID attribute value of the element to be signed.signatureMethod
- The value of the Algorithm
attribute of the
SignatureMethod
element contained within the
new Signature
element's SignedInfo
child element.c14nMethod
- The value of the Algorithm
attribute of the
CanonicalizationMethod
element contained within
the new Signature
element's SignedInfo
child element .digestMethod
- The value of the Algorithm
attribute of the
DigestMethod
element of the new Signature
's
Reference
element.localNames
- The ordered set of the local names of all the child elements precede
the Signature element in the schema for the element represented
by the message.nsURIs
- The ordered set of the namespace URIs of the child elements precede
the Signature element in the schema for the element represented
by the message.oracle.security.xmlsec.dsig.XSSignature
objectpublic static java.lang.String signURL(java.lang.String msg, java.security.PrivateKey key, java.lang.String sigAlgURI) throws SigningException
msg
- The data to be signed.key
- The private signing key.sigAlgURI
- The URI identifying the signature algorithm to use.SigningException
- If an error occurs computing the signature.