Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jss.pkcs11
Class PK11Store

    java.lang.Object
      |
      +--org.mozilla.jss.pkcs11.PK11Store

All Implemented Interfaces:
  CryptoStore

public final class PK11Store
extends java.lang.Object
implements CryptoStore

Field Summary
`protected TokenProxy` | `storeProxy`
`protected boolean` | `updated`

Constructor Summary
`protected` | `PK11Store()`
`` | `PK11Store(TokenProxy proxy)`

Method Summary
`void` | `deleteCert(X509Certificate cert)` Deletes a certificate from a token.
`void` | `deletePrivateKey(PrivateKey key)` Deletes the given PrivateKey from the CryptoToken.
`X509Certificate[]` | `getCertificates()` Returns all user certificates stored on this token.
`byte[]` | `getEncryptedPrivateKeyInfo(X509Certificate cert, PBEAlgorithm pbeAlg, Password pw, int iteration)`
`PrivateKey[]` | `getPrivateKeys()` Returns all private keys stored on this token.
`void` | `importPrivateKey(byte[] key, PrivateKey.Type type)` Imports a raw private key into this token.
`protected void` | `putCertsInVector(java.util.Vector certs)`
`protected void` | `putKeysInVector(java.util.Vector keys)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### updated

    protected boolean updated

### storeProxy

    protected TokenProxy storeProxy

Constructor Detail

### PK11Store

    public PK11Store(TokenProxy proxy)

### PK11Store

    protected PK11Store()

Method Detail

### importPrivateKey

    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.

### getPrivateKeys

    public PrivateKey[] getPrivateKeys()
                                throws TokenException

  Description copied from interface: `CryptoStore`
  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.

### putKeysInVector

    protected void putKeysInVector(java.util.Vector keys)
                            throws TokenException

    `TokenException`

### deletePrivateKey

    public void deletePrivateKey(PrivateKey key)
                          throws NoSuchItemOnTokenException,
                                 TokenException

  Description copied from interface: `CryptoStore`
  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:
    `TokenException` - If an error occurs on the token while deleting the key.
    `NoSuchItemOnTokenException` - If the given privae key does not reside on this token.

### getEncryptedPrivateKeyInfo

    public byte[] getEncryptedPrivateKeyInfo(X509Certificate cert,
                                             PBEAlgorithm pbeAlg,
                                             Password pw,
                                             int iteration)

  Specified by:
    `getEncryptedPrivateKeyInfo` in interface `CryptoStore`

### getCertificates

    public X509Certificate[] getCertificates()
                                      throws TokenException

  Description copied from interface: `CryptoStore`
  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.

### putCertsInVector

    protected void putCertsInVector(java.util.Vector certs)
                             throws TokenException

    `TokenException`

### deleteCert

    public void deleteCert(X509Certificate cert)
                    throws NoSuchItemOnTokenException,
                           TokenException

  Description copied from interface: `CryptoStore`
  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:
    `TokenException` - If an error occurred on the token while deleting the certificate.
    `NoSuchItemOnTokenException` - If the given cert does not reside on this token.

Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD