JSS 3.1.2

org.mozilla.jss.pkcs12
Class PK12Token.PK12Store

java.lang.Object
  |
  +--org.mozilla.jss.pkcs12.PK12Token.PK12Store
All Implemented Interfaces:
CryptoStore
Enclosing class:
PK12Token

protected abstract class PK12Token.PK12Store
extends java.lang.Object
implements CryptoStore


Constructor Summary
protected PK12Token.PK12Store()
           
 
Method Summary
private  PK12TokenProxy createPK12TokenExportContext()
          These private native methods are always called via the protected synchronized java method called exportToPKCS12File(): createPK12TokenExportContext(): creates, opens, and truncates the PKCS #12 file intended for export exportPK12Token(): actually exports a single piece of data from the Java data member "certificates" along with its corresponding private key if it exists destroyPK12TokenExportContext(): closes the PKCS #12 file intended for export CALLED BY: exportToPKCS12File()
 void deleteObjectByNickname(java.lang.String nickname)
           
 void deletePasswordByNickname(java.lang.String nickname)
           
 void deletePrivKey(PrivateKey key)
           
private  void destroyPK12TokenExportContext(PK12TokenProxy exportProxy)
           
private  void exportPK12Token(PK12TokenProxy exportProxy, X509Certificate certificate)
           
protected  void exportToPKCS12File()
          This protected synchronized method is always called whenever it is known that a file does NOT exist (as denoted by the second argument to the PK12Token factory "constructor" method).
 X509Certificate getCertByDER(byte[] derCert)
           
 X509Certificate getCertByIssuerAndSerialNum(byte[] derIssuer, java.lang.String issuer, long serialNumber)
           
 X509Certificate getCertByNickname(java.lang.String nickname)
           
 java.io.Serializable getObjectByNickname(java.lang.String nickname)
           
 Password getPasswordByNickname(java.lang.String nickname)
           
 PrivateKey getPrivKeyByCert(java.security.cert.Certificate cert)
           
 PrivateKey getPrivKeyByKeyID(byte[] keyID)
           
 void storeCertByNickname(X509Certificate newCertificate, java.lang.String nickname)
          Add a new certificate to the private "certificates" data member.
 void storeObjectByNickname(java.io.Serializable object, java.lang.String nickname)
           
 void storePasswordByNickname(Password password, java.lang.String nickname)
           
 void storePrivKey(PrivateKey newKey)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface org.mozilla.jss.crypto.CryptoStore
deleteCert, deletePrivateKey, getCertificates, getPrivateKeys, importPrivateKey
 

Constructor Detail

PK12Token.PK12Store

protected PK12Token.PK12Store()
Method Detail

getCertByNickname

public X509Certificate getCertByNickname(java.lang.String nickname)
                                  throws ObjectNotFoundException,
                                         NotImplementedException,
                                         TokenException

getCertByDER

public X509Certificate getCertByDER(byte[] derCert)
                             throws ObjectNotFoundException,
                                    NotImplementedException,
                                    InvalidDERException,
                                    TokenException

getCertByIssuerAndSerialNum

public X509Certificate getCertByIssuerAndSerialNum(byte[] derIssuer,
                                                   java.lang.String issuer,
                                                   long serialNumber)
                                            throws ObjectNotFoundException,
                                                   NotImplementedException,
                                                   InvalidDERException,
                                                   TokenException

storeCertByNickname

public void storeCertByNickname(X509Certificate newCertificate,
                                java.lang.String nickname)
                         throws NoSuchItemOnTokenException,
                                NotImplementedException,
                                TokenException
Add a new certificate to the private "certificates" data member. For example:
     storeCertByNickname( certificate, nickname );
 
Parameters:
newCertificate - The new certificate which must already exist on the corresponding PKCS #11 token.
Throws:
NoSuchItemOnTokenException - This exception is thrown in the case of an inability to remove the certificate from the vector.

getPrivKeyByKeyID

public PrivateKey getPrivKeyByKeyID(byte[] keyID)
                             throws NoSuchItemOnTokenException,
                                    NotImplementedException,
                                    TokenException

getPrivKeyByCert

public PrivateKey getPrivKeyByCert(java.security.cert.Certificate cert)
                            throws ObjectNotFoundException,
                                   NotImplementedException,
                                   java.lang.IllegalArgumentException,
                                   TokenException

deletePrivKey

public void deletePrivKey(PrivateKey key)
                   throws NotImplementedException,
                          NoSuchItemOnTokenException,
                          TokenException

storePrivKey

public void storePrivKey(PrivateKey newKey)
                  throws NoSuchItemOnTokenException,
                         NotImplementedException,
                         TokenException

storePasswordByNickname

public void storePasswordByNickname(Password password,
                                    java.lang.String nickname)
                             throws NotImplementedException,
                                    TokenException

getPasswordByNickname

public Password getPasswordByNickname(java.lang.String nickname)
                               throws ObjectNotFoundException,
                                      NotImplementedException,
                                      TokenException

deletePasswordByNickname

public void deletePasswordByNickname(java.lang.String nickname)
                              throws ObjectNotFoundException,
                                     NotImplementedException,
                                     TokenException

storeObjectByNickname

public void storeObjectByNickname(java.io.Serializable object,
                                  java.lang.String nickname)
                           throws NotImplementedException,
                                  TokenException

getObjectByNickname

public java.io.Serializable getObjectByNickname(java.lang.String nickname)
                                         throws ObjectNotFoundException,
                                                NotImplementedException,
                                                TokenException

deleteObjectByNickname

public void deleteObjectByNickname(java.lang.String nickname)
                            throws ObjectNotFoundException,
                                   NotImplementedException,
                                   TokenException

exportToPKCS12File

protected void exportToPKCS12File()
This protected synchronized method is always called whenever it is known that a file does NOT exist (as denoted by the second argument to the PK12Token factory "constructor" method). This method is called whenever a certificate, or a certificate along with its corresponding private key need to be saved to an external file. In each case, this new file, referenced by the PK12Token "file" data member, is created/recreated and EVERYTHING in the "certificates" PK12Token data member is copied into this new PKCS #12 file. CALLED BY: storeCertByNickname()

createPK12TokenExportContext

private PK12TokenProxy createPK12TokenExportContext()
These private native methods are always called via the protected synchronized java method called exportToPKCS12File(): createPK12TokenExportContext(): creates, opens, and truncates the PKCS #12 file intended for export exportPK12Token(): actually exports a single piece of data from the Java data member "certificates" along with its corresponding private key if it exists destroyPK12TokenExportContext(): closes the PKCS #12 file intended for export CALLED BY: exportToPKCS12File()

exportPK12Token

private void exportPK12Token(PK12TokenProxy exportProxy,
                             X509Certificate certificate)

destroyPK12TokenExportContext

private void destroyPK12TokenExportContext(PK12TokenProxy exportProxy)

JSS 3.1.2