Package org.mozilla.jss.crypto
Class KeyPairAlgorithm
- java.lang.Object
-
- org.mozilla.jss.crypto.Algorithm
-
- org.mozilla.jss.crypto.KeyPairAlgorithm
-
public class KeyPairAlgorithm extends Algorithm
Algorithms that can be used for keypair generation.
-
-
Field Summary
Fields Modifier and Type Field Description protected Algorithm
algFamily
static KeyPairAlgorithm
DSA
static Algorithm
DSAFamily
static KeyPairAlgorithm
EC
static Algorithm
ECFamily
static KeyPairAlgorithm
RSA
static Algorithm
RSAFamily
-
Fields inherited from class org.mozilla.jss.crypto.Algorithm
CKM_AES_CBC, CKM_AES_CBC_PAD, CKM_AES_CMAC, CKM_AES_ECB, CKM_AES_KEY_GEN, CKM_AES_KEY_WRAP, CKM_AES_KEY_WRAP_PAD, CKM_DES_CBC_PAD, CKM_DES_KEY_GEN, CKM_DES3_CBC_PAD, CKM_DES3_ECB, CKM_DES3_KEY_GEN, CKM_DSA_KEY_PAIR_GEN, CKM_EC_KEY_PAIR_GEN, CKM_GENERIC_SECRET_KEY_GEN, CKM_NSS_AES_KEY_WRAP, CKM_NSS_AES_KEY_WRAP_PAD, CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA, CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA, CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA, CKM_PBA_SHA1_WITH_SHA1_HMAC, CKM_RC2_CBC_PAD, CKM_RC2_KEY_GEN, CKM_RC4_KEY_GEN, CKM_RSA_PKCS_KEY_PAIR_GEN, CKM_SHA_1_HMAC, CKM_SHA256_HMAC, CKM_SHA384_HMAC, CKM_SHA512_HMAC, CKM_SP800_108_COUNTER_KDF, CKM_SP800_108_DOUBLE_PIPELINE_KDF, CKM_SP800_108_FEEDBACK_KDF, oid, oidIndex, SEC_OID_AES_128_CBC, SEC_OID_AES_128_ECB, SEC_OID_AES_192_CBC, SEC_OID_AES_192_ECB, SEC_OID_AES_256_CBC, SEC_OID_AES_256_ECB, SEC_OID_ANSIX9_DSA_SIGNATURE, SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST, SEC_OID_ANSIX962_EC_PUBLIC_KEY, SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE, SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE, SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE, SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE, SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, SEC_OID_DES_CBC, SEC_OID_DES_ECB, SEC_OID_DES_EDE3_CBC, SEC_OID_HMAC_SHA256, SEC_OID_HMAC_SHA384, SEC_OID_HMAC_SHA512, SEC_OID_MD2, SEC_OID_MD5, SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION, SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION, SEC_OID_PKCS1_RSA_ENCRYPTION, SEC_OID_PKCS1_RSA_PSS_SIGNATURE, SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION, SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION, SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION, SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION, SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC, SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4, SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC, SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC, SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4, SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC, SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC, SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC, SEC_OID_PKCS5_PBES2, SEC_OID_PKCS5_PBKDF2, SEC_OID_PKCS5_PBMAC1, SEC_OID_RC2_CBC, SEC_OID_RC4, SEC_OID_SHA1, SEC_OID_SHA256, SEC_OID_SHA384, SEC_OID_SHA512
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KeyPairAlgorithm(int oidIndex, java.lang.String name, Algorithm algFamily)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeyPairAlgorithm
fromString(java.lang.String algName)
Looks up a key pair generation algorithm from its name.Algorithm
getAlgFamily()
Returns the algorithm family for a given key pair generation algorithm.-
Methods inherited from class org.mozilla.jss.crypto.Algorithm
getEnum, getParameterClass, getParameterClasses, isValidParameterObject, toOID, toString
-
-
-
-
Field Detail
-
algFamily
protected Algorithm algFamily
-
RSAFamily
public static final Algorithm RSAFamily
-
DSAFamily
public static final Algorithm DSAFamily
-
ECFamily
public static final Algorithm ECFamily
-
RSA
public static final KeyPairAlgorithm RSA
-
DSA
public static final KeyPairAlgorithm DSA
-
EC
public static final KeyPairAlgorithm EC
-
-
Constructor Detail
-
KeyPairAlgorithm
protected KeyPairAlgorithm(int oidIndex, java.lang.String name, Algorithm algFamily)
-
-
Method Detail
-
getAlgFamily
public Algorithm getAlgFamily()
Returns the algorithm family for a given key pair generation algorithm. If a token supports a family and is writable, we can do keypair gen on the token even if it doesn't support the keypair gen algorithm. We do this by doing the keypair gen on the internal module and then moving the key out to the other token.- Returns:
- Algorithm family.
-
fromString
public static KeyPairAlgorithm fromString(java.lang.String algName) throws java.security.NoSuchAlgorithmException
Looks up a key pair generation algorithm from its name. The names are those specified in the JCA spec. For example, "RSA" and "DSA".- Parameters:
algName
- Algorithm name.- Returns:
- Key pair generation algorithm.
- Throws:
java.security.NoSuchAlgorithmException
- If the name of the algorithm is not recognized as a supported algorithm.
-
-