Skip navigation links

Oracle Security Developer Tools XML Security Java API Reference
11g (11.1.1)

E10680-02


oracle.security.xmlsec.dsig
Class XSSignatureValue

java.lang.Object
  extended by oracle.security.xmlsec.util.XMLNode
      extended by oracle.security.xmlsec.util.XMLElement
          extended by oracle.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)
          Wrapper over fromDSA(byte[], int) with size=20 for SHA-1.
static byte[] fromDSA(byte[] dsaVal, int size)
          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, getElement, 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.
Throws:
org.w3c.dom.DOMException

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.
Throws:
org.w3c.dom.DOMException
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
Throws:
org.w3c.dom.DOMException

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.
Throws:
org.w3c.dom.DOMException

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.
Throws:
org.w3c.dom.DOMException

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.
Throws:
org.w3c.dom.DOMException

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)
Wrapper over fromDSA(byte[], int) with size=20 for SHA-1. For SHA2 functions, use that function directly.

fromDSA

public static byte[] fromDSA(byte[] dsaVal,
                             int size)
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 s Converts a DSA signature value from ASN.1 format to PKCS#1 octet-stream format.
dsaVal - Converts a DSA signature value from ASN.1 format to PKCS#1 octet-stream format.
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 size 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 (SHA1 - 20 bytes, SHA256 - 32 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 }
                        
.

Skip navigation links

Oracle Security Developer Tools XML Security Java API Reference
11g (11.1.1)

E10680-02


Copyright © 2005, 2009, Oracle. All rights reserved.