org.mozilla.jss.pkcs11
Class PK11PrivKey
java.lang.Object
org.mozilla.jss.pkcs11.PK11Key
org.mozilla.jss.pkcs11.PK11PrivKey
- PrivateKey
public class PK11PrivKey
extends org.mozilla.jss.pkcs11.PK11Key
PK11PrivKey
protected PK11PrivKey(byte[] pointer)
fromPrivateKeyInfo
public static PK11PrivKey fromPrivateKeyInfo(PKCS8EncodedKeySpec spec,
CryptoToken token)
throws TokenException
Imports a PrivateKeyInfo, storing it as a temporary PrivateKey
on the given token.
The key will be a temporary (session) key until it is imported
into a KeyStore, at which point it will be made a permanent (token)
object.
fromPrivateKeyInfo
public static PK11PrivKey fromPrivateKeyInfo(byte[] pki,
CryptoToken token)
throws TokenException
Imports a PrivateKeyInfo, storing it as a temporary PrivateKey
on the given token.
The key will be a temporary (session) key until it is imported
into a KeyStore, at which point it will be made a permanent (token)
object.
fromPrivateKeyInfo
public static PK11PrivKey fromPrivateKeyInfo(byte[] pki,
CryptoToken token,
byte[] publicValue)
throws TokenException
Imports a PrivateKeyInfo, storing it as a temporary PrivateKey
on the given token.
The key will be a temporary (session) key until it is imported
into a KeyStore, at which point it will be made a permanent (token)
object.
publicValue
- An encoding of the public key, as used by the NSS
pk11wrap code. Don't use this unless you know what you're doing.
getAlgorithm
public String getAlgorithm()
getDSAParams
protected DSAParameterSpec getDSAParams()
throws TokenException
getKeyType
public org.mozilla.jss.pkcs11.KeyType getKeyType()
getStrength
public int getStrength()
Returns the size in bits of the modulus of an RSA Private key.
Returns -1 for other types of keys.
- getStrength in interface PrivateKey
getUniqueID
public byte[] getUniqueID()
throws TokenException
This ID is based on an implementation that might change.
If this functionality is required, it should be provided in
another way, such as a function that directly matches a cert and
key.
Returns the unique ID of this key. Unique IDs can be used to match
certificates to keys.
- getUniqueID in interface PrivateKey