Oracle Security Developer Tools XKMS Java API Reference
10g (10.1.4.0.1)

B28176-01


oracle.security.xmlsec.xkms.util
Class XKMSUtils

java.lang.Object
  extended byoracle.security.xmlsec.xkms.util.XKMSUtils


public class XKMSUtils
extends java.lang.Object

A set of Utility functions.


Constructor Summary
XKMSUtils()
           

 

Method Summary
static byte[] doMacAuthN(byte[] data, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Convert the shared secret to an Authentication Key as per section 8.1 of the XKMS specification.
static byte[] doMacPrivateKey(byte[] data, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID, int length)
          Convert the shared secret to a private key data as per section 8.1 of the XKMS specification.
static byte[] doMacRC(byte[] data, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Convert the shared secret to an Authentication Key as per section 8.1 of the XKMS specification.
static byte[] doMacRCI(byte[] data, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Convert the shared secret to a RevocationCode as per section 8.1 of the XKMS specification.
static byte[] generateNonce(java.util.Date time, java.math.BigInteger serialNo, byte[] secretKey, oracle.security.crypto.core.AlgorithmIdentifier hmacAlgID)
          Generate the Nonce as per the algorithm specified in Section 2.6.2 of the W3C XKMS specification.
static oracle.security.xmlsec.util.XMLElement getInstance(org.w3c.dom.Element element)
          Instantiates a concrete Message subclass implementation to wrap the given Element.
static void insertChild(org.w3c.dom.Element parent, org.w3c.dom.Element e, java.lang.String[] tag, java.lang.String[] ns)
          Inserts a child element after any occurrences of the given elements.
static void insertChild(oracle.security.xmlsec.util.XMLElement parent, oracle.security.xmlsec.util.XMLElement e, java.lang.String[] tag, java.lang.String[] ns)
          Inserts a child element after any occurrences of the given elements.
static void removeChildren(org.w3c.dom.Element parent, java.lang.String tag, java.lang.String ns)
          Removes any child elements with the given tag name.
static byte[] secretString2Bytes(java.lang.String secret)
          Convert the shared secret to bytes as per section 8.1 of the XKMS specification.

 

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

 

Constructor Detail

XKMSUtils

public XKMSUtils()

Method Detail

secretString2Bytes

public static byte[] secretString2Bytes(java.lang.String secret)
                                 throws java.io.UnsupportedEncodingException
Convert the shared secret to bytes as per section 8.1 of the XKMS specification.

Note: This method only supports a subset of RFC 4103 stringprep profile.

Parameters:
secret - The shared secret used to derive the keying material.
Returns:
The converted bytes.
Throws:
java.io.UnsupportedEncodingException

doMacAuthN

public static byte[] doMacAuthN(byte[] data,
                                oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
                         throws oracle.security.crypto.core.AlgorithmIdentifierException
Convert the shared secret to an Authentication Key as per section 8.1 of the XKMS specification.
Parameters:
data - The input material.
hashAlgID - The MAC algorithm.
Returns:
The derived key bytes.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException

doMacRC

public static byte[] doMacRC(byte[] data,
                             oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
                      throws oracle.security.crypto.core.AlgorithmIdentifierException
Convert the shared secret to an Authentication Key as per section 8.1 of the XKMS specification.
Parameters:
data - The input material.
hashAlgID - The MAC algorithm.
Returns:
The derived key bytes.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException

doMacRCI

public static byte[] doMacRCI(byte[] data,
                              oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
                       throws oracle.security.crypto.core.AlgorithmIdentifierException
Convert the shared secret to a RevocationCode as per section 8.1 of the XKMS specification.
Parameters:
data - The input material.
hashAlgID - The MAC algorithm.
Returns:
The derived revocation code bytes.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException

doMacPrivateKey

public static byte[] doMacPrivateKey(byte[] data,
                                     oracle.security.crypto.core.AlgorithmIdentifier hashAlgID,
                                     int length)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException
Convert the shared secret to a private key data as per section 8.1 of the XKMS specification.
Parameters:
data - The input material.
hashAlgID - The MAC algorithm.
length - The number of key bytes to generate.
Returns:
The derived revocation code identifier bytes.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException

insertChild

public static void insertChild(oracle.security.xmlsec.util.XMLElement parent,
                               oracle.security.xmlsec.util.XMLElement e,
                               java.lang.String[] tag,
                               java.lang.String[] ns)
                        throws org.w3c.dom.DOMException
Inserts a child element after any occurrences of the given elements.
Parameters:
parent - The element to which a child will be appended.
e - The child element to insert.
tag - An array of element tag names after any occurrence of which the child element is to be inserted. The tags must be presented in the order in which they appear in the parent element's schema.
ns - An array of namespace URIs corresponding to the tag names in the tag array.
Throws:
org.w3c.dom.DOMException

insertChild

public static void insertChild(org.w3c.dom.Element parent,
                               org.w3c.dom.Element e,
                               java.lang.String[] tag,
                               java.lang.String[] ns)
                        throws org.w3c.dom.DOMException
Inserts a child element after any occurrences of the given elements.
Parameters:
parent - The element to which a child will be appended.
e - The child element to insert.
tag - An array of element tag names after any occurrence of which the child element is to be inserted. The tags must be presented in the order in which they appear in the parent element's schema.
ns - An array of namespace URIs corresponding to the tag names in the tag array.
Throws:
org.w3c.dom.DOMException

removeChildren

public static void removeChildren(org.w3c.dom.Element parent,
                                  java.lang.String tag,
                                  java.lang.String ns)
Removes any child elements with the given tag name.
Parameters:
parent - The element whose children will be removed.
tag - The tag name of the child element(s) to remove.
ns - The namespace URI of the element(s) to remove.

generateNonce

public static byte[] generateNonce(java.util.Date time,
                                   java.math.BigInteger serialNo,
                                   byte[] secretKey,
                                   oracle.security.crypto.core.AlgorithmIdentifier hmacAlgID)
                            throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                   java.io.IOException
Generate the Nonce as per the algorithm specified in Section 2.6.2 of the W3C XKMS specification.
Parameters:
time - The current time.
serialNo - A unique serial number.
secretKey - The MAC key.
hmacAlgID - The MAC algorithm identifier.
Returns:
The raw nonce bytes.
Throws:
java.io.IOException
oracle.security.crypto.core.AlgorithmIdentifierException

getInstance

public static oracle.security.xmlsec.util.XMLElement getInstance(org.w3c.dom.Element element)
                                                          throws org.w3c.dom.DOMException
Instantiates a concrete Message subclass implementation to wrap the given Element.
Parameters:
element - An org.w3c.dom.Element that conforms to an element from the xkms schema.
Returns:
A subclass of XMLElement, or null if no appropriate implementation class could be found.
Throws:
org.w3c.dom.DOMException

Oracle Security Developer Tools XKMS Java API Reference
10g (10.1.4.0.1)

B28176-01


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