public static class OpenSSHKeyPairResourceWriter.KeyEncryptor extends AESPrivateKeyObfuscator
| Modifier and Type | Field and Description |
|---|---|
static int |
BCRYPT_SALT_LENGTH |
protected OpenSSHKeyEncryptionContext |
options |
CIPHER_NAME, INSTANCE| Constructor and Description |
|---|
KeyEncryptor(OpenSSHKeyEncryptionContext options) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
convert(String password) |
protected byte[] |
deriveEncryptionKey(PrivateKeyEncryptionContext context,
int keyLength)
Derives an encryption key and set the IV on the
context from the passphase provided by the context
using the OpenBSD BCrypt KDF. |
byte[] |
getKdfOptions()
Retrieves the KDF options used.
|
applyPrivateKeyCipher, createCipherSelector, getAvailableKeyLengths, getSupportedKeySizes, resolveCipherInformation, resolveInitializationVectorLength, resolveKeyLengthappendPrivateKeyEncryptionContext, applyPrivateKeyCipher, generateInitializationVector, getCipherNamepublic static final int BCRYPT_SALT_LENGTH
protected final OpenSSHKeyEncryptionContext options
public KeyEncryptor(OpenSSHKeyEncryptionContext options)
public byte[] getKdfOptions()
deriveEncryptionKey(PrivateKeyEncryptionContext, int) has been called.protected byte[] deriveEncryptionKey(PrivateKeyEncryptionContext context, int keyLength) throws IOException, GeneralSecurityException
context from the passphase provided by the context
using the OpenBSD BCrypt KDF.deriveEncryptionKey in class AbstractPrivateKeyObfuscatorcontext - for the encryption, provides the passphrase and transports other encryption-related
information including the IVkeyLength - number of key bytes to generatekeyLength bytes to use as encryption keyIOExceptionGeneralSecurityExceptionprotected byte[] convert(String password)
Copyright © 2018–2024 The Apache Software Foundation. All rights reserved.