public abstract class WLCertManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
clearKeystore(java.lang.String provisioningEntity)
Remove the keystore
|
java.security.KeyPair |
generateKeyPair(java.lang.String provisioningEntity,
int rsaKeySize)
Generate a keypair(private + public) key set, for use with signing metadata.
|
java.security.KeyPair |
getKeyPair(java.lang.String provisioningEntity) |
void |
init(Context ctx)
Initialize state variables for this device auth session
|
void |
removeEntityKeyStoreValues(java.lang.String provisioningEntity)
Remove the
|
java.lang.String |
signCsr(JSONObject csrJSON,
java.lang.String provisioningEntity)
This method signs on a given content according to JWS standard
(JSON Web Signature - http://datatracker.ietf.org/doc/draft-ietf-jose-json-web-signature/?include_text=1)
We'll be using the public key
We use the SHA256withRSA algorithm for creating the JWS header
|
java.lang.String |
signJWS(JSONObject payladJSON,
java.security.interfaces.RSAPublicKey publicKey,
java.security.PrivateKey privateKey,
java.lang.String kid) |
public void init(Context ctx)
ctx - public java.security.KeyPair generateKeyPair(java.lang.String provisioningEntity,
int rsaKeySize)
throws java.security.NoSuchAlgorithmException,
java.io.IOException,
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmExceptionjava.io.IOExceptionjava.security.NoSuchProviderExceptionpublic java.lang.String signCsr(JSONObject csrJSON,
java.lang.String provisioningEntity)
throws java.lang.Exception
csrJSON - - a JSON Object with the content to sign onprovisioningEntity - java.lang.Exceptionpublic java.lang.String signJWS(JSONObject payladJSON,
java.security.interfaces.RSAPublicKey publicKey,
java.security.PrivateKey privateKey,
java.lang.String kid)
throws JSONException,
java.io.UnsupportedEncodingException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.SignatureException
JSONExceptionjava.io.UnsupportedEncodingExceptionjava.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.SignatureExceptionpublic void clearKeystore(java.lang.String provisioningEntity)
throws java.security.KeyStoreException
java.security.KeyStoreExceptionpublic void removeEntityKeyStoreValues(java.lang.String provisioningEntity)
throws java.security.KeyStoreException
java.security.KeyStoreExceptionpublic java.security.KeyPair getKeyPair(java.lang.String provisioningEntity)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.UnrecoverableEntryException,
java.io.IOException,
java.lang.ClassNotFoundException
java.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableEntryExceptionjava.io.IOExceptionjava.lang.ClassNotFoundException