Oracle Security Developer Tools XML Security Java API Reference
10g Release 2 (10.1.2.0.2)

B15571-01


oracle.security.xmlsec.dsig
Class XSSignatureValue

java.lang.Object
  extended byoracle.security.xmlsec.util.XMLNode
      extended byoracle.security.xmlsec.util.XMLElement
          extended byoracle.security.xmlsec.dsig.XSSignatureValue


public class XSSignatureValue
extends XMLElement

Class representing a XML-DSIG SignatureValue element.

See Also:
XSSignature.createSignatureValue()

Field Summary

Fields inherited from class oracle.security.xmlsec.util.XMLNode
node, systemId

Constructor Summary
XSSignatureValue(org.w3c.dom.Document owner)
Creates a new XSSignatureValue instance.
XSSignatureValue(org.w3c.dom.Document owner, byte[] sigBytes)
Creates a new XSSignatureValue instance.
XSSignatureValue(org.w3c.dom.Document owner, byte[] sigBytes, java.lang.String id)
Creates a new XSSignatureValue instance.
XSSignatureValue(org.w3c.dom.Document owner, java.lang.String id)
Creates a new XSSignatureValue instance.
XSSignatureValue(org.w3c.dom.Element element)
Creates a new XSSignatureValue instance from the given Element node.
XSSignatureValue(org.w3c.dom.Element element, java.lang.String systemId)
Creates a new XSSignatureValue instance from the given Element node.

Method Summary
static byte[] fromDSA(byte[] dsaVal)
Converts a DSA signature value from ASN.1 format to PKCS#1 octet-stream format.
java.lang.String getId()
Returns the string value of the Id attribute of this SignatureValue, or null if the attribute is missing.
byte[] getSignatureBytes()
Returns the signature bytes.
void setId(java.lang.String id)
Sets the Id attribute of this SignatureValue.
void setSignatureBytes(byte[] sigBytes)
Sets the signature bytes for this SignatureValue element.
static byte[] toDSA(byte[] sigVal)
Converts a DSA signature value from PKCS#1 octet-stream format to ASN.1 format.

Methods inherited from class oracle.security.xmlsec.util.XMLElement
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefix

Methods inherited from class oracle.security.xmlsec.util.XMLNode
appendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Element element)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance from the given Element node.
Parameters:
element - An Element node in the XML document that conforms to the XML-DSIG SignatureValue schema.

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Element element,
                        java.lang.String systemId)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance from the given Element node.
Parameters:
element - An Element node in the XML document that conforms to the XML-DSIG SignatureValue schema.
systemId - The URI string system ID for this element.
Since:
2.0
See Also:
XMLNode.setSystemId(java.lang.String)

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Document owner)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance.
Parameters:
owner - The owner document of the new XSSignatureValue

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Document owner,
                        java.lang.String id)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance.
Parameters:
owner - The owner document of the new XSSignatureValue
id - An optional string ID name for this SignatureValue structure.

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Document owner,
                        byte[] sigBytes)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance.
Parameters:
owner - The owner document of the new XSSignatureValue
sigBytes - A byte array containing the signature.

XSSignatureValue

public XSSignatureValue(org.w3c.dom.Document owner,
                        byte[] sigBytes,
                        java.lang.String id)
                 throws org.w3c.dom.DOMException
Creates a new XSSignatureValue instance.
Parameters:
owner - The owner document of the new XSSignatureValue
sigBytes - A byte array containing the signature.
id - An optional string ID name for this SignatureValue structure.

Method Detail

setId

public void setId(java.lang.String id)
           throws org.w3c.dom.DOMException
Sets the Id attribute of this SignatureValue.
Throws:
org.w3c.dom.DOMException

getId

public java.lang.String getId()
Returns the string value of the Id attribute of this SignatureValue, or null if the attribute is missing.

setSignatureBytes

public void setSignatureBytes(byte[] sigBytes)
                       throws org.w3c.dom.DOMException
Sets the signature bytes for this SignatureValue element.
Parameters:
sigBytes - A byte array containing the signature.
Throws:
org.w3c.dom.DOMException

getSignatureBytes

public byte[] getSignatureBytes()
                         throws org.w3c.dom.DOMException
Returns the signature bytes.
Returns:
A newly allocated byte array containing the signature, or null if none have been set.
Throws:
org.w3c.dom.DOMException

fromDSA

public static byte[] fromDSA(byte[] dsaVal)
Converts a DSA signature value from ASN.1 format to PKCS#1 octet-stream format.
Parameters:
dsaVal - The bytes of an ASN.1 DER-encoded DSA signature value of the form
                                Dss-Sig-Value ::= SEQUENCE {
                                        r INTEGER,
                                        s INTEGER }
                        
.
Returns:
A byte array containing r and s, each encoded in 20 bytes as per PKCS#1 and concatenated.

toDSA

public static byte[] toDSA(byte[] sigVal)
Converts a DSA signature value from PKCS#1 octet-stream format to ASN.1 format.
Parameters:
sigVal - A byte array containing the DSA signature integer values r and s, each encoded in 20 bytes as per PKCS#1 and concatenated.
Returns:
The bytes of an ASN.1 DER-encoded DSA signature value of the form
                                Dss-Sig-Value ::= SEQUENCE {
                                        r INTEGER,
                                        s INTEGER }
                        
.

Oracle Security Developer Tools XML Security Java API Reference
10g Release 2 (10.1.2.0.2)

B15571-01


Copyright © 2005 , Oracle. All rights reserved.