org.mozilla.jss.crypto

Class Algorithm

public class Algorithm extends Object

Represents a cryptographic algorithm.

See Also: EncryptionAlgorithm SignatureAlgorithm

Field Summary
protected static shortCKM_AES_CBC
protected static shortCKM_AES_CBC_PAD
protected static shortCKM_AES_ECB
protected static shortCKM_AES_KEY_GEN
protected static shortCKM_DES3_CBC_PAD
protected static shortCKM_DES3_ECB
protected static shortCKM_DES3_KEY_GEN
protected static shortCKM_DES_CBC_PAD
protected static shortCKM_DES_KEY_GEN
protected static shortCKM_DSA_KEY_PAIR_GEN
protected static shortCKM_EC_KEY_PAIR_GEN
protected static shortCKM_PBA_SHA1_WITH_SHA1_HMAC
protected static shortCKM_RC2_CBC_PAD
protected static shortCKM_RC2_KEY_GEN
protected static shortCKM_RC4_KEY_GEN
protected static shortCKM_RSA_PKCS_KEY_PAIR_GEN
protected static shortCKM_SHA_1_HMAC
protected OBJECT_IDENTIFIERoid
protected intoidIndex
Index into the SECOidTag array in Algorithm.c.
protected static shortSEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE
protected static shortSEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE
protected static shortSEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE
protected static shortSEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE
protected static shortSEC_OID_ANSIX962_EC_PUBLIC_KEY
protected static shortSEC_OID_ANSIX9_DSA_SIGNATURE
protected static shortSEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST
protected static shortSEC_OID_DES_CBC
protected static shortSEC_OID_DES_ECB
protected static shortSEC_OID_DES_EDE3_CBC
protected static shortSEC_OID_MD2
protected static shortSEC_OID_MD5
protected static shortSEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC
protected static shortSEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4
protected static shortSEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC
protected static shortSEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC
protected static shortSEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4
protected static shortSEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION
protected static shortSEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC
protected static shortSEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC
protected static shortSEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC
protected static shortSEC_OID_RC2_CBC
protected static shortSEC_OID_RC4
protected static shortSEC_OID_SHA1
protected static shortSEC_OID_SHA256
protected static shortSEC_OID_SHA384
protected static shortSEC_OID_SHA512
Constructor Summary
protected Algorithm(int oidIndex, String name)
protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid)
protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid, Class paramClass)
protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid, Class[] paramClasses)
Method Summary
ClassgetParameterClass()
The type of parameter that this algorithm expects.
Class[]getParameterClasses()
The types of parameter that this algorithm expects.
booleanisValidParameterObject(Object o)
Returns true if the given Object can be used as a parameter for this algorithm.
OBJECT_IDENTIFIERtoOID()
Returns the object identifier for this algorithm.
StringtoString()
Returns a String representation of the algorithm.

Field Detail

CKM_AES_CBC

protected static final short CKM_AES_CBC

CKM_AES_CBC_PAD

protected static final short CKM_AES_CBC_PAD

CKM_AES_ECB

protected static final short CKM_AES_ECB

CKM_AES_KEY_GEN

protected static final short CKM_AES_KEY_GEN

CKM_DES3_CBC_PAD

protected static final short CKM_DES3_CBC_PAD

CKM_DES3_ECB

protected static final short CKM_DES3_ECB

CKM_DES3_KEY_GEN

protected static final short CKM_DES3_KEY_GEN

CKM_DES_CBC_PAD

protected static final short CKM_DES_CBC_PAD

CKM_DES_KEY_GEN

protected static final short CKM_DES_KEY_GEN

CKM_DSA_KEY_PAIR_GEN

protected static final short CKM_DSA_KEY_PAIR_GEN

CKM_EC_KEY_PAIR_GEN

protected static final short CKM_EC_KEY_PAIR_GEN

CKM_PBA_SHA1_WITH_SHA1_HMAC

protected static final short CKM_PBA_SHA1_WITH_SHA1_HMAC

CKM_RC2_CBC_PAD

protected static final short CKM_RC2_CBC_PAD

CKM_RC2_KEY_GEN

protected static final short CKM_RC2_KEY_GEN

CKM_RC4_KEY_GEN

protected static final short CKM_RC4_KEY_GEN

CKM_RSA_PKCS_KEY_PAIR_GEN

protected static final short CKM_RSA_PKCS_KEY_PAIR_GEN

CKM_SHA_1_HMAC

protected static final short CKM_SHA_1_HMAC

oid

protected OBJECT_IDENTIFIER oid

oidIndex

protected int oidIndex
Index into the SECOidTag array in Algorithm.c.

SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE

protected static final short SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE

SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE

protected static final short SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE

SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE

protected static final short SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE

SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE

protected static final short SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE

SEC_OID_ANSIX962_EC_PUBLIC_KEY

protected static final short SEC_OID_ANSIX962_EC_PUBLIC_KEY

SEC_OID_ANSIX9_DSA_SIGNATURE

protected static final short SEC_OID_ANSIX9_DSA_SIGNATURE

SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST

protected static final short SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST

SEC_OID_DES_CBC

protected static final short SEC_OID_DES_CBC

SEC_OID_DES_ECB

protected static final short SEC_OID_DES_ECB

SEC_OID_DES_EDE3_CBC

protected static final short SEC_OID_DES_EDE3_CBC

SEC_OID_MD2

protected static final short SEC_OID_MD2

SEC_OID_MD5

protected static final short SEC_OID_MD5

SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC

protected static final short SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC

SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4

protected static final short SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4

SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC

protected static final short SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC

SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC

protected static final short SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC

SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4

protected static final short SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4

SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION

SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION

SEC_OID_PKCS1_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_RSA_ENCRYPTION

SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION

SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION

SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION

SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION

protected static final short SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION

SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC

protected static final short SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC

SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC

protected static final short SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC

SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC

protected static final short SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC

SEC_OID_RC2_CBC

protected static final short SEC_OID_RC2_CBC

SEC_OID_RC4

protected static final short SEC_OID_RC4

SEC_OID_SHA1

protected static final short SEC_OID_SHA1

SEC_OID_SHA256

protected static final short SEC_OID_SHA256

SEC_OID_SHA384

protected static final short SEC_OID_SHA384

SEC_OID_SHA512

protected static final short SEC_OID_SHA512

Constructor Detail

Algorithm

protected Algorithm(int oidIndex, String name)

Parameters: oidIndex Index of the oid that this algorithm represents. name A String representation of the Algorithm.

Algorithm

protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid)

Parameters: oidIndex Index of the oid that this algorithm represents. name A String representation of the Algorithm. oid The object identifier for this Algorithm.

Algorithm

protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid, Class paramClass)

Algorithm

protected Algorithm(int oidIndex, String name, OBJECT_IDENTIFIER oid, Class[] paramClasses)

Method Detail

getParameterClass

public Class getParameterClass()

Deprecated: Call getParameterClasses() instead.

The type of parameter that this algorithm expects. Returns null if this algorithm does not take any parameters. If the algorithm can accept more than one type of parameter, this method returns only one of them. It is better to call getParameterClasses().

getParameterClasses

public Class[] getParameterClasses()
The types of parameter that this algorithm expects. Returns null if this algorithm does not take any parameters.

isValidParameterObject

public boolean isValidParameterObject(Object o)
Returns true if the given Object can be used as a parameter for this algorithm.

If null is passed in, this method will return true if this algorithm takes no parameters, and false if this algorithm does take parameters.

toOID

public OBJECT_IDENTIFIER toOID()
Returns the object identifier for this algorithm.

Throws: NoSuchAlgorithmException If no OID is registered for this algorithm.

toString

public String toString()
Returns a String representation of the algorithm.