Class PKCS8KeyFile

    • Field Detail

      • BOUNCY_CASTLE_CLASS

        private static final java.lang.String BOUNCY_CASTLE_CLASS
        Bouncy Castle class for detecting support of historical OpenSSL password-based decryption
        See Also:
        Constant Field Values
      • HISTORICAL_DECRYPTION_SUPPORTED

        private static final boolean HISTORICAL_DECRYPTION_SUPPORTED
      • log

        protected final org.slf4j.Logger log
    • Constructor Detail

      • PKCS8KeyFile

        public PKCS8KeyFile()
    • Method Detail

      • readKeyPair

        protected java.security.KeyPair readKeyPair()
                                             throws java.io.IOException
        Specified by:
        readKeyPair in class BaseFileKeyProvider
        Throws:
        java.io.IOException
      • readKeyPair

        private java.security.KeyPair readKeyPair​(PEMKey pemKey)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • readDsaKeyPair

        private java.security.KeyPair readDsaKeyPair​(byte[] pemKeyBody)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readRsaKeyPair

        private java.security.KeyPair readRsaKeyPair​(byte[] pemKeyBody)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readEcKeyPair

        private java.security.KeyPair readEcKeyPair​(byte[] pemKeyBody)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readEncryptedPkcs8KeyPair

        private java.security.KeyPair readEncryptedPkcs8KeyPair​(byte[] pemKeyBody)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getPkcs8DecryptedKeySpec

        private java.security.spec.PKCS8EncodedKeySpec getPkcs8DecryptedKeySpec​(char[] password,
                                                                                byte[] encoded)
                                                                         throws java.io.IOException,
                                                                                java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • getPkcs8KeyPair

        private java.security.KeyPair getPkcs8KeyPair​(byte[] encoded)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getPkcs8KeyPair

        private java.security.KeyPair getPkcs8KeyPair​(PKCS8KeyFile.KeyAlgorithmObjectIdentifier objectIdentifier,
                                                      byte[] privateKeyInfo)
                                               throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • getPkcs8PrivateKey

        private java.security.PrivateKey getPkcs8PrivateKey​(PKCS8KeyFile.KeyAlgorithmObjectIdentifier objectIdentifier,
                                                            byte[] privateKeyInfo)
                                                     throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • getEcPublicKey

        private java.security.PublicKey getEcPublicKey​(byte[] bitString,
                                                       java.security.spec.ECParameterSpec ecParameterSpec)
                                                throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • getBigInteger

        private java.math.BigInteger getBigInteger​(com.hierynomus.asn1.types.constructed.ASN1Sequence sequence,
                                                   int index)
      • isHistoricalDecryptionSupported

        private static boolean isHistoricalDecryptionSupported()