| java.lang.Object com.sun.satsa.pki.PKIManager
PKIManager | public class PKIManager (Code) | | This class provides implementation of methods defined by
javax.microedition.pki.UserCredentialManager and
javax.microedition.securityservice.CMSMessageSignatureService
classes.
|
Method Summary | |
public static synchronized boolean | addCredential(String certDisplayName, byte[] pkiPath, String uri) Adds a user certificate to a certificate store.
Parameters: certDisplayName - the user friendly name associated with thecertificate. Parameters: pkiPath - the DER encoded PKIPath containing usercertificate and certificate authority certificates. Parameters: uri - a URI that resolves to a X.509v3 certificate. | public static synchronized byte[] | generateCSR(String nameInfo, String algorithm, int keyLen, int keyUsage, String securityElementID, String securityElementPrompt, boolean forceKeyGen) Creates a DER encoded PKCS#10 certificate enrollment request.
Parameters: nameInfo - the distinguished name to be included in thePKCS#10 certificate signing request. Parameters: algorithm - the Object Identifier (OID) for the public keyalgorithm to use. Parameters: keyLen - the key length. Parameters: keyUsage - the functionality for which the key is markedinside the security element. Parameters: securityElementID - identifies the security element on whichthe key resides. Parameters: securityElementPrompt - guides a user to insert the correctsecurity element, if a suitable security element is removable andnot detected. Parameters: forceKeyGen - if set to true a new key MUST be generated. | public static boolean | removeCredential(String certDisplayName, byte[] issuerAndSerialNumber, String securityElementID, String securityElementPrompt) Removes a certificate from a certificate store.
Parameters: certDisplayName - the user friendly name associated with thecertificate. Parameters: issuerAndSerialNumber - the DER encoded ASN.1 structure thatcontains the certificate issuer and serial number. Parameters: securityElementID - identifies the security element on whichthe key resides. Parameters: securityElementPrompt - guides the user to insert thecorrect security element if the security element is removable andnot detected. | public static byte[] | sign(int action, byte[] data, String string, int options, String[] caNames, String securityElementPrompt) Generates a signature.
Parameters: action - type of signature operation. Parameters: data - data to be signed or null Parameters: string - string to be signed or null Parameters: options - signature format options Parameters: caNames - an array of Strings that contain the distinguishednames of trusted certification authorities. Parameters: securityElementPrompt - guides a user to insert the correctsecurity element if the security element is removable and notdetected. |
AUTHENTICATE_DATA | final public static int AUTHENTICATE_DATA(Code) | | Signature operation identifier.
|
AUTHENTICATE_STRING | final public static int AUTHENTICATE_STRING(Code) | | Signature operation identifier.
|
SIGN_STRING | final public static int SIGN_STRING(Code) | | Signature operation identifier.
|
addCredential | public static synchronized boolean addCredential(String certDisplayName, byte[] pkiPath, String uri) throws UserCredentialManagerException(Code) | | Adds a user certificate to a certificate store.
Parameters: certDisplayName - the user friendly name associated with thecertificate. Parameters: pkiPath - the DER encoded PKIPath containing usercertificate and certificate authority certificates. Parameters: uri - a URI that resolves to a X.509v3 certificate. true if successful throws: UserCredentialManagerException - if an error occurs whileadding a user credential throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
generateCSR | public static synchronized byte[] generateCSR(String nameInfo, String algorithm, int keyLen, int keyUsage, String securityElementID, String securityElementPrompt, boolean forceKeyGen) throws UserCredentialManagerException, CMSMessageSignatureServiceException(Code) | | Creates a DER encoded PKCS#10 certificate enrollment request.
Parameters: nameInfo - the distinguished name to be included in thePKCS#10 certificate signing request. Parameters: algorithm - the Object Identifier (OID) for the public keyalgorithm to use. Parameters: keyLen - the key length. Parameters: keyUsage - the functionality for which the key is markedinside the security element. Parameters: securityElementID - identifies the security element on whichthe key resides. Parameters: securityElementPrompt - guides a user to insert the correctsecurity element, if a suitable security element is removable andnot detected. Parameters: forceKeyGen - if set to true a new key MUST be generated. DER encoded PKCS#10 certificate enrollment request throws: UserCredentialManagerException - if an error occurs whilegenerating the certificate request throws: CMSMessageSignatureServiceException - if an error occurswhile signing the certificate request throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
removeCredential | public static boolean removeCredential(String certDisplayName, byte[] issuerAndSerialNumber, String securityElementID, String securityElementPrompt) throws UserCredentialManagerException(Code) | | Removes a certificate from a certificate store.
Parameters: certDisplayName - the user friendly name associated with thecertificate. Parameters: issuerAndSerialNumber - the DER encoded ASN.1 structure thatcontains the certificate issuer and serial number. Parameters: securityElementID - identifies the security element on whichthe key resides. Parameters: securityElementPrompt - guides the user to insert thecorrect security element if the security element is removable andnot detected. false if operation cancelled throws: UserCredentialManagerException - ifan error occurs while removing the credential throws: SecurityException - if a PIN is blocked due to an excessivenumber of incorrect PIN entries |
sign | public static byte[] sign(int action, byte[] data, String string, int options, String[] caNames, String securityElementPrompt) throws CMSMessageSignatureServiceException, UserCredentialManagerException(Code) | | Generates a signature.
Parameters: action - type of signature operation. Parameters: data - data to be signed or null Parameters: string - string to be signed or null Parameters: options - signature format options Parameters: caNames - an array of Strings that contain the distinguishednames of trusted certification authorities. Parameters: securityElementPrompt - guides a user to insert the correctsecurity element if the security element is removable and notdetected. the DER encoded signature, null if the signaturegeneration was cancelled by the user before completion throws: CMSMessageSignatureServiceException - if an error occursduring signature generation throws: UserCredentialManagerException - if key not found throws: SecurityException - if caller does not have permission |
|
|