public final class AWSIotKeystoreHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AWS_IOT_INTERNAL_KEYSTORE_PASSWORD
Constant for internal IoT SDK KeyStore password.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteKeystoreAlias(String certId,
String keystorePath,
String keystoreName,
String keystorePassword)
Delete an certificate/private key entry from a keystore.
|
static KeyPair |
generatePrivateAndPublicKeys()
Generate private and public keys.
|
static KeyStore |
getIotKeystore(String certId,
InputStream keyStoreInputStream,
String keyStorePassword)
Get certificate and private key from stream.
|
static KeyStore |
getIotKeystore(String certId,
String keystorePath,
String keystoreName,
String keyStorePassword)
Get certificate and private key from keystore on the file system.
|
static Boolean |
isKeystorePresent(String keystorePath,
String keystoreName)
Check if a keystore is present.
|
static Boolean |
keystoreContainsAlias(String certId,
String keystorePath,
String keystoreName,
String keystorePassword)
Check if a cert/key alias is present in a keystore.
|
static void |
saveCertificateAndPrivateKey(String certId,
String certPem,
PrivateKey privKey,
String keystorePath,
String keystoreName,
String keystorePassword)
Save private key and public key and certificate in keystore file on the
filesystem.
|
static void |
saveCertificateAndPrivateKey(String certId,
String certPem,
String keyPem,
String keystorePath,
String keystoreName,
String keystorePassword)
Save private key and public key and certificate in keystore.
|
public static final String AWS_IOT_INTERNAL_KEYSTORE_PASSWORD
public static KeyPair generatePrivateAndPublicKeys()
public static void saveCertificateAndPrivateKey(String certId, String certPem, PrivateKey privKey, String keystorePath, String keystoreName, String keystorePassword)
certId - The certificate ID or alias in the keystore.certPem - The certificate in PEM format.privKey - The private key.keystorePath - The path to keystore.keystoreName - The name of the keystore.keystorePassword - The password for the keystore.public static void saveCertificateAndPrivateKey(String certId, String certPem, String keyPem, String keystorePath, String keystoreName, String keystorePassword)
certId - The certificate ID or alias in the keystore.certPem - The certificate in PEM format.keyPem - The private key in PEM format. Can handle with or without
BEGIN RSA/END RSA strings.keystorePath - The path to keystore.keystoreName - The name of the keystore.keystorePassword - The password for the keystore.public static KeyStore getIotKeystore(String certId, String keystorePath, String keystoreName, String keyStorePassword)
certId - The certificate Id or alias.keystorePath - The path to keystore.keystoreName - The keystore filename.keyStorePassword - The password for the keystore.public static KeyStore getIotKeystore(String certId, InputStream keyStoreInputStream, String keyStorePassword)
certId - The certificate Id or alias.keyStoreInputStream - an InputStream of a Keystore.keyStorePassword - The password for the keystore.public static Boolean isKeystorePresent(String keystorePath, String keystoreName)
keystorePath - The path to keystore.keystoreName - The keystore filename.public static Boolean keystoreContainsAlias(String certId, String keystorePath, String keystoreName, String keystorePassword)
certId - The certificate Id or alias.keystorePath - The path to keystore.keystoreName - The keystore filename.keystorePassword - The Password for the keystore.public static void deleteKeystoreAlias(String certId, String keystorePath, String keystoreName, String keystorePassword)
certId - The certificate Id or alias.keystorePath - The path to keystore.keystoreName - The keystore filename.keystorePassword - The Password for the keystore.Copyright © 2017. All rights reserved.