Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.mozilla.jss.pkcs11.PK11Store
Field Summary | |
protected TokenProxy | |
protected boolean |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
X509Certificate[] |
|
byte[] |
|
PrivateKey[] |
|
void |
|
protected void |
|
protected void |
|
public void deleteCert(X509Certificate cert) throws NoSuchItemOnTokenException, TokenException
Deletes a certificate from a token.
- Specified by:
- deleteCert in interface CryptoStore
- Parameters:
cert
- A certificate to be deleted from this token. The cert must actually reside on this token.
- Throws:
NoSuchItemOnTokenException
- If the given cert does not reside on this token.TokenException
- If an error occurred on the token while deleting the certificate.
public void deletePrivateKey(PrivateKey key) throws NoSuchItemOnTokenException, TokenException
Deletes the given PrivateKey from the CryptoToken. This is a very dangerous call: it deletes the key from the underlying token. After calling this, the PrivateKey passed in must no longer be used, or a TokenException will occur.
- Specified by:
- deletePrivateKey in interface CryptoStore
- Parameters:
key
- A PrivateKey to be permanently deleted. It must reside on this token.
- Throws:
NoSuchItemOnTokenException
- If the given privae key does not reside on this token.TokenException
- If an error occurs on the token while deleting the key.
public X509Certificate[] getCertificates() throws TokenException
Returns all user certificates stored on this token. A user certificate is one that has a matching private key.
- Specified by:
- getCertificates in interface CryptoStore
- Returns:
- An array of all user certificates present on this token.
- Throws:
TokenException
- If an error occurs on the token while gathering the certificates.
public byte[] getEncryptedPrivateKeyInfo(X509Certificate cert, PBEAlgorithm pbeAlg, Password pw, int iteration)
- Specified by:
- getEncryptedPrivateKeyInfo in interface CryptoStore
public PrivateKey[] getPrivateKeys() throws TokenException
Returns all private keys stored on this token.
- Specified by:
- getPrivateKeys in interface CryptoStore
- Returns:
- An array of all private keys stored on this token.
- Throws:
TokenException
- If an error occurs on the token while gathering the keys.
public void importPrivateKey(byte[] key, PrivateKey.Type type) throws TokenException, KeyAlreadyImportedException
Imports a raw private key into this token.
- Specified by:
- importPrivateKey in interface CryptoStore
- Parameters:
key
- The private key.
- Throws:
TokenException
- If the key cannot be imported to this token.KeyAlreadyImportedException
- If the key already on this token.