| java.lang.Object com.sun.satsa.pki.WIMApplication
WIMApplication | class WIMApplication (Code) | | This class provides interface to WIM card application.
|
Field Summary | |
final static int | CANCEL Operation result constant. | final static int | ERROR Operation result constant. | final static byte | INS_NEW INS byte for command APDU. | final static int | SKIP Operation result constant (skip this SE and try next). | final static int | SUCCESS Operation result constant. |
Method Summary | |
public int | addCredential(String label, TLV top, Vector keyIDs) Adds a user certificate or certificate URI to a certificate store.
See UserCredentialManager.addCredential for details. | public void | done() Safely closes the connection. | public byte[] | generateCSR(String nameInfo, int keyLen, int keyUsage, boolean forceKeyGen, Vector keyIDs) Generates CSR. | int | generateKey(int keyLen, int keyUsage) Generates new key. | public byte[] | generateSignature(boolean nonRepudiation, byte[] data, int options, TLV[] caNames) Generates a signature. | public static WIMApplication | getInstance(SecurityToken token, int slotNum, String securityElementID, boolean readOnly) Creates connection with WIM application (WIM spec, 11.3.3) on
card in specified slot. | public int | removeCredential(String label, TLV isn) Removes credential. |
CANCEL | final static int CANCEL(Code) | | Operation result constant.
|
ERROR | final static int ERROR(Code) | | Operation result constant.
|
INS_NEW | final static byte INS_NEW(Code) | | INS byte for command APDU.
|
SKIP | final static int SKIP(Code) | | Operation result constant (skip this SE and try next).
|
SUCCESS | final static int SUCCESS(Code) | | Operation result constant.
|
addCredential | public int addCredential(String label, TLV top, Vector keyIDs)(Code) | | Adds a user certificate or certificate URI to a certificate store.
See UserCredentialManager.addCredential for details. Calling
method must remove leading and trailing spaces in label.
Parameters: label - the user friendly name associated with thecertificate Parameters: top - chain of certificates from pkiPath Parameters: keyIDs - vector that contains identifiers of keys for whichcertificates are expected operation result throws: IllegalArgumentException - if certificate parsing erroroccurs or label is not unique or user credential exists already throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
done | public void done()(Code) | | Safely closes the connection.
|
generateCSR | public byte[] generateCSR(String nameInfo, int keyLen, int keyUsage, boolean forceKeyGen, Vector keyIDs) throws UserCredentialManagerException, CMSMessageSignatureServiceException(Code) | | Generates CSR. See UserCredentialManager.generateCSR for details.
The calling method must load a vector that contains IDs of keys
for which CSRs were generated earlier and save it after successful
CSR generation.
Parameters: nameInfo - certificate subject name Parameters: keyLen - key length Parameters: keyUsage - key usage Parameters: forceKeyGen - if set to true a new key must be generated Parameters: keyIDs - IDs of keys for which CSRs were generated earlier.If the new CSR is generated, the key ID is added into this vector. the new CSR or null if operation cancelled throws: UserCredentialManagerException - if key is not found throws: CMSMessageSignatureServiceException - if CSR generationfailed throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
generateKey | int generateKey(int keyLen, int keyUsage) throws IOException, InterruptedException(Code) | | Generates new key.
Parameters: keyLen - key length Parameters: keyUsage - key usage key reference or -1 if the key generation is notsupported or -2 if key cannot be generated throws: IOException - if I/O error occurs throws: InterruptedException - if interrupted |
generateSignature | public byte[] generateSignature(boolean nonRepudiation, byte[] data, int options, TLV[] caNames) throws CMSMessageSignatureServiceException(Code) | | Generates a signature.
Parameters: nonRepudiation - if true, the non-repudiation key must beused, otherwise - authentication key Parameters: data - the data to be signed Parameters: options - signature content options Parameters: caNames - array that contains parsed names of certificateauthorities the DER encoded signature, null if the signaturegeneration was cancelled by the user before completion throws: CMSMessageSignatureServiceException - if an error occursduring signature generation |
getInstance | public static WIMApplication getInstance(SecurityToken token, int slotNum, String securityElementID, boolean readOnly)(Code) | | Creates connection with WIM application (WIM spec, 11.3.3) on
card in specified slot. Doesn't throw exceptions.
Parameters: token - security token Parameters: slotNum - the slot number Parameters: securityElementID - identifies the security element Parameters: readOnly - if true WIM data can be protected WIMApplication object or null. |
removeCredential | public int removeCredential(String label, TLV isn)(Code) | | Removes credential.
Parameters: label - the user friendly name associated with thecertificate. Parameters: isn - the DER encoded ASN.1 structure that contains thecertificate issuer and serial number operation result throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
|
|