Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-04


oracle.security.crypto.cms
Class CMSUtils

java.lang.Object
  extended by oracle.security.crypto.cms.CMSUtils


public class CMSUtils
extends java.lang.Object

Utility functions for users of this package.


Constructor Summary
CMSUtils()
           

 

Method Summary
static java.lang.String addPadding(java.lang.String algoName)
           
static boolean checkKeyParity(javax.crypto.SecretKey key, int parity)
          Check the least significant bit of each key byte for the parity indicated -- 1 for odd parity or 0 for even parity.
static oracle.security.crypto.cert.X509 convertX509(java.security.cert.X509Certificate cert)
          Converts an X509Certificate object to an X509 object
static byte[] generateKeyID(java.security.PublicKey key)
           
static byte[] generateSPKI160(java.security.cert.X509Certificate cert)
          Generates a 160 bit Subject Key Identifier as per RFC-2459.
static byte[] generateSPKI64(java.security.cert.X509Certificate cert)
          Generates a 64 bit Subject Key Identifier as per RFC-2459.
static oracle.security.crypto.core.AlgorithmIdentifier getAlgoID(java.lang.String name)
          Algoname to algoId mapping
static java.lang.String getAlgoName(oracle.security.crypto.core.AlgorithmIdentifier oid)
          Algoid to algoname mapping
static java.lang.String getAlgoName(oracle.security.crypto.core.AlgorithmIdentifier oid, boolean removeMode)
          Algoid to algoname mapping
static java.lang.String getSigAlgName(java.lang.String encId, java.lang.String digId)
           
static void setKeyParity(javax.crypto.SecretKey key, int parity)
          Set the least significant bit of each key byte so that it has the parity indicated -- 1 for odd parity or 0 for even parity.
static java.util.Vector toJCECertVector(java.util.Vector certs)
           
static java.security.PublicKey toJCEPublicKey(oracle.security.crypto.core.PublicKey phaoskey)
           
static java.security.cert.X509Certificate toX509JCECertificate(oracle.security.crypto.cert.X509 cert)
           
static java.util.Vector toX509Vector(java.util.Vector certs)
          Converts a Vector of X509Certificate Objects to a Vector of X509 objects

 

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

 

Constructor Detail

CMSUtils

public CMSUtils()

Method Detail

generateSPKI64

public static byte[] generateSPKI64(java.security.cert.X509Certificate cert)
                             throws java.security.NoSuchAlgorithmException
Generates a 64 bit Subject Key Identifier as per RFC-2459.
Parameters:
cert - The public key X509 certificate.
Returns:
The 64 bit key identifier.
Throws:
java.security.NoSuchAlgorithmException

generateSPKI160

public static byte[] generateSPKI160(java.security.cert.X509Certificate cert)
                              throws java.security.NoSuchAlgorithmException
Generates a 160 bit Subject Key Identifier as per RFC-2459.
Parameters:
cert - The public key X509 certificate.
Returns:
The 160 bit key identifier.
Throws:
java.security.NoSuchAlgorithmException

getAlgoID

public static oracle.security.crypto.core.AlgorithmIdentifier getAlgoID(java.lang.String name)
                                                                 throws java.security.NoSuchAlgorithmException
Algoname to algoId mapping
Parameters:
name - Name of the algorithm
Returns:
AlgorithmIdentifier corresponding to the name of the algorithm
Throws:
java.security.NoSuchAlgorithmException

getAlgoName

public static java.lang.String getAlgoName(oracle.security.crypto.core.AlgorithmIdentifier oid)
                                    throws java.security.NoSuchAlgorithmException
Algoid to algoname mapping
Parameters:
oid - Algorithmidentifier for which algorithm name is required
Returns:
The algorithm name corresponding to the algoid
Throws:
java.security.NoSuchAlgorithmException

getAlgoName

public static java.lang.String getAlgoName(oracle.security.crypto.core.AlgorithmIdentifier oid,
                                           boolean removeMode)
                                    throws java.security.NoSuchAlgorithmException
Algoid to algoname mapping
Parameters:
oid - Algorithmidentifier for which algorithm name is required
boolean - is set to true in case the mode in the algoname needs to be removed for instance while creating an instance of KeyGenerator
Returns:
The algorithm name corresponding to the algoid
Throws:
java.security.NoSuchAlgorithmException

generateKeyID

public static byte[] generateKeyID(java.security.PublicKey key)
                            throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException

setKeyParity

public static void setKeyParity(javax.crypto.SecretKey key,
                                int parity)
Set the least significant bit of each key byte so that it has the parity indicated -- 1 for odd parity or 0 for even parity. This applies primarily to DES and DES-EDE keys.
Parameters:
key - The key for which parity is to be set.
parity - 1 for odd parity or 0 for even parity.

checkKeyParity

public static boolean checkKeyParity(javax.crypto.SecretKey key,
                                     int parity)
Check the least significant bit of each key byte for the parity indicated -- 1 for odd parity or 0 for even parity. This applies primarily to DES and DES-EDE keys.
Parameters:
key - The key for which parity is to be set.
parity - 1 for odd parity or 0 for even parity.
Returns:
true if each byte has the specified parity otherwise false

getSigAlgName

public static java.lang.String getSigAlgName(java.lang.String encId,
                                             java.lang.String digId)

addPadding

public static java.lang.String addPadding(java.lang.String algoName)
Parameters:
algoName -
Returns:
String - the name of the algorithm with the PKCS5Padding appended

convertX509

public static oracle.security.crypto.cert.X509 convertX509(java.security.cert.X509Certificate cert)
                                                    throws java.security.cert.CertificateEncodingException
Converts an X509Certificate object to an X509 object
Parameters:
cert - X509Certificate object
Returns:
X509 object
Throws:
java.security.cert.CertificateEncodingException

toX509Vector

public static java.util.Vector toX509Vector(java.util.Vector certs)
                                     throws java.security.cert.CertificateEncodingException
Converts a Vector of X509Certificate Objects to a Vector of X509 objects
Throws:
java.security.cert.CertificateEncodingException

toJCECertVector

public static java.util.Vector toJCECertVector(java.util.Vector certs)
                                        throws java.security.cert.CertificateException
Throws:
java.security.cert.CertificateException

toX509JCECertificate

public static java.security.cert.X509Certificate toX509JCECertificate(oracle.security.crypto.cert.X509 cert)
                                                               throws java.security.cert.CertificateException
Throws:
java.security.cert.CertificateException

toJCEPublicKey

public static java.security.PublicKey toJCEPublicKey(oracle.security.crypto.core.PublicKey phaoskey)
                                              throws java.security.NoSuchAlgorithmException,
                                                     java.security.spec.InvalidKeySpecException
Throws:
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException

Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-04


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