Class OpenSSHKeyPairResourceWriter.KeyEncryptor

    • Method Detail

      • deriveEncryptionKey

        protected byte[] deriveEncryptionKey​(PrivateKeyEncryptionContext context,
                                             int keyLength)
                                      throws java.io.IOException,
                                             java.security.GeneralSecurityException
        Derives an encryption key and set the IV on the context from the passphase provided by the context using the OpenBSD BCrypt KDF.
        Overrides:
        deriveEncryptionKey in class AbstractPrivateKeyObfuscator
        Parameters:
        context - for the encryption, provides the passphrase and transports other encryption-related information including the IV
        keyLength - number of key bytes to generate
        Returns:
        keyLength bytes to use as encryption key
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • convert

        protected byte[] convert​(java.lang.String password)