org.mozilla.jss.pkcs12
Class PK12Token

org.mozilla.jss.pkcs12.PK12Token

public class PK12Token

A PKCS #12 "virtual token". Currently, these extend tokens found in the PK11Token class.

See Also:
PK12Token

Inner Class Summary
static class PK12Token.Flag
           
static interface PK12Token.InvalidPKCS12FileException
          Thrown if the operation requires a specified file to exist, and it doesn't.
 
Method Summary
static PK12Token makePK12Token(java.lang.String filename, PK12Token.Flag flag)
          A user calls this static factory method instead of a java constructer to initialize the PK12Token class.
 

Method Detail

makePK12Token

public static PK12Token makePK12Token(java.lang.String filename,
                                      PK12Token.Flag flag)
A user calls this static factory method instead of a java constructer to initialize the PK12Token class. This native function obtains a PKCS #11 slot, transforms it into a JNI byte array, and then calls the protected java constructor, PK12Token( filename, flag, slot ). For example:
     PK12Token token = makePK12Token( "pkcs12file.p12",
                                      PK12Token.Flag.FILE_EXISTS );
 
Parameters:
filename - A String containing the name of a PKCS #12 file.
flag - A Flag containing whether the PKCS #12 file should already exist (in which case "flag" is Flag.FILE_EXISTS) or should be created (in which case "flag" is Flag.CREATE_FILE).
Returns:
PK12Token This method actually invokes the constructor.