Class AbstractPrivateKeyObfuscator

    • Field Detail

      • algName

        private final java.lang.String algName
    • Constructor Detail

      • AbstractPrivateKeyObfuscator

        protected AbstractPrivateKeyObfuscator​(java.lang.String name)
    • Method Detail

      • getCipherName

        public final java.lang.String getCipherName()
        Specified by:
        getCipherName in interface PrivateKeyObfuscator
        Returns:
        Basic cipher used to obfuscate
      • generateInitializationVector

        public byte[] generateInitializationVector​(PrivateKeyEncryptionContext encContext)
                                            throws java.security.GeneralSecurityException
        Specified by:
        generateInitializationVector in interface PrivateKeyObfuscator
        Parameters:
        encContext - The encryption context
        Returns:
        An initialization vector suitable to the specified context
        Throws:
        java.security.GeneralSecurityException
      • appendPrivateKeyEncryptionContext

        public <A extends java.lang.Appendable> A appendPrivateKeyEncryptionContext​(A sb,
                                                                                    PrivateKeyEncryptionContext encContext)
                                                                             throws java.io.IOException
        Specified by:
        appendPrivateKeyEncryptionContext in interface PrivateKeyObfuscator
        Type Parameters:
        A - Appendable generic type
        Parameters:
        sb - The Appendable instance to update
        Returns:
        Same appendable instance
        Throws:
        java.io.IOException
      • resolveInitializationVectorLength

        protected abstract int resolveInitializationVectorLength​(PrivateKeyEncryptionContext encContext)
                                                          throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • resolveKeyLength

        protected abstract int resolveKeyLength​(PrivateKeyEncryptionContext encContext)
                                         throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • deriveEncryptionKey

        protected byte[] deriveEncryptionKey​(PrivateKeyEncryptionContext encContext,
                                             int outputKeyLength)
                                      throws java.io.IOException,
                                             java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • applyPrivateKeyCipher

        protected byte[] applyPrivateKeyCipher​(byte[] bytes,
                                               PrivateKeyEncryptionContext encContext,
                                               int numBits,
                                               byte[] keyValue,
                                               boolean encryptIt)
                                        throws java.io.IOException,
                                               java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException