org.mozilla.jss.crypto

Class KeyPairAlgorithm

public class KeyPairAlgorithm extends Algorithm

Algorithms that can be used for keypair generation.
Field Summary
protected AlgorithmalgFamily
static KeyPairAlgorithmDSA
static AlgorithmDSAFamily
static KeyPairAlgorithmEC
static AlgorithmECFamily
static KeyPairAlgorithmRSA
static AlgorithmRSAFamily
Constructor Summary
protected KeyPairAlgorithm(int oidIndex, String name, Algorithm algFamily)
Method Summary
static KeyPairAlgorithmfromString(String algName)
Looks up a key pair generation algorithm from its name.
AlgorithmgetAlgFamily()
Returns the algorithm family for a given key pair generation algorithm.

Field Detail

algFamily

protected Algorithm algFamily

DSA

public static final KeyPairAlgorithm DSA

DSAFamily

public static final Algorithm DSAFamily

EC

public static final KeyPairAlgorithm EC

ECFamily

public static final Algorithm ECFamily

RSA

public static final KeyPairAlgorithm RSA

RSAFamily

public static final Algorithm RSAFamily

Constructor Detail

KeyPairAlgorithm

protected KeyPairAlgorithm(int oidIndex, String name, Algorithm algFamily)

Method Detail

fromString

public static KeyPairAlgorithm fromString(String algName)
Looks up a key pair generation algorithm from its name. The names are those specified in the JCA spec. For example, "RSA" and "DSA".

Throws: NoSuchAlgorithmException If the name of the algorithm is not recognized as a supported algorithm.

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.