public final class AWSIotKeystoreHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AWS_IOT_INTERNAL_KEYSTORE_PASSWORD
Constant for internal IoT SDK KeyStore password.
|
Modifier and Type | Method and Description |
---|---|
static void |
deleteKeystoreAlias(java.lang.String certId,
java.lang.String keystorePath,
java.lang.String keystoreName,
java.lang.String keystorePassword)
Delete an certificate/private key entry from a keystore.
|
static java.security.KeyPair |
generatePrivateAndPublicKeys()
Generate private and public keys.
|
static java.security.KeyStore |
getIotKeystore(java.lang.String certId,
java.io.InputStream keyStoreInputStream,
java.lang.String keyStorePassword)
Get certificate and private key from stream.
|
static java.security.KeyStore |
getIotKeystore(java.lang.String certId,
java.lang.String keystorePath,
java.lang.String keystoreName,
java.lang.String keyStorePassword)
Get certificate and private key from keystore on the file system.
|
static java.lang.Boolean |
isKeystorePresent(java.lang.String keystorePath,
java.lang.String keystoreName)
Check if a keystore is present.
|
static java.lang.Boolean |
keystoreContainsAlias(java.lang.String certId,
java.lang.String keystorePath,
java.lang.String keystoreName,
java.lang.String keystorePassword)
Check if a cert/key alias is present in a keystore.
|
static void |
saveCertificateAndPrivateKey(java.lang.String certId,
java.lang.String certPem,
java.security.PrivateKey privKey,
java.lang.String keystorePath,
java.lang.String keystoreName,
java.lang.String keystorePassword)
Save private key and public key and certificate in keystore file on the
filesystem.
|
static void |
saveCertificateAndPrivateKey(java.lang.String certId,
java.lang.String certPem,
java.lang.String keyPem,
java.lang.String keystorePath,
java.lang.String keystoreName,
java.lang.String keystorePassword)
Save private key and public key and certificate in keystore.
|
public static final java.lang.String AWS_IOT_INTERNAL_KEYSTORE_PASSWORD
public static java.security.KeyPair generatePrivateAndPublicKeys()
public static void saveCertificateAndPrivateKey(java.lang.String certId, java.lang.String certPem, java.security.PrivateKey privKey, java.lang.String keystorePath, java.lang.String keystoreName, java.lang.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(java.lang.String certId, java.lang.String certPem, java.lang.String keyPem, java.lang.String keystorePath, java.lang.String keystoreName, java.lang.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 java.security.KeyStore getIotKeystore(java.lang.String certId, java.lang.String keystorePath, java.lang.String keystoreName, java.lang.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 java.security.KeyStore getIotKeystore(java.lang.String certId, java.io.InputStream keyStoreInputStream, java.lang.String keyStorePassword)
certId
- The certificate Id or alias.keyStoreInputStream
- an InputStream of a Keystore.keyStorePassword
- The password for the keystore.public static java.lang.Boolean isKeystorePresent(java.lang.String keystorePath, java.lang.String keystoreName)
keystorePath
- The path to keystore.keystoreName
- The keystore filename.public static java.lang.Boolean keystoreContainsAlias(java.lang.String certId, java.lang.String keystorePath, java.lang.String keystoreName, java.lang.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(java.lang.String certId, java.lang.String keystorePath, java.lang.String keystoreName, java.lang.String keystorePassword)
certId
- The certificate Id or alias.keystorePath
- The path to keystore.keystoreName
- The keystore filename.keystorePassword
- The Password for the keystore.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.