Class PKCS8EncryptionProperties

    • Constructor Summary

      Constructors 
      Constructor Description
      PKCS8EncryptionProperties()
      Creates a set of PKCS #8 encryption properties with the default settings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PKCS5AlgorithmIdentifier getCipherTransformationAlgorithm()
      Retrieves the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
      int getKeyFactoryIterationCount()
      Retrieves the iteration count to use when generating the encryption key from the provided password.
      PKCS5AlgorithmIdentifier getKeyFactoryPRFAlgorithm()
      Retrieves the algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.
      int getKeyFactorySaltLengthBytes()
      Retrieves the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
      void setCipherTransformationAlgorithm​(PKCS5AlgorithmIdentifier cipherTransformationAlgorithm)
      Specifies the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
      void setKeyFactoryIterationCount​(int keyFactoryIterationCount)
      Specifies the iteration count to use when generating the encryption key from the provided password.
      void setKeyFactoryPRFAlgorithm​(PKCS5AlgorithmIdentifier keyFactoryPRFAlgorithm)
      Specifies the algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password.
      void setKeyFactorySaltLengthBytes​(int keyFactorySaltLengthBytes)
      Specifies the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
      java.lang.String toString()
      Retrieves a string representation of the PKCS #8 encryption properties.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of the PKCS #8 encryption properties to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PKCS8EncryptionProperties

        public PKCS8EncryptionProperties()
        Creates a set of PKCS #8 encryption properties with the default settings.
    • Method Detail

      • getKeyFactoryPRFAlgorithm

        @NotNull
        public PKCS5AlgorithmIdentifier getKeyFactoryPRFAlgorithm()
        Retrieves the algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.
        Returns:
        The algorithm identifier for the pseudorandom function to use for the key factory when generating the encryption key from the provided password.
      • setKeyFactoryPRFAlgorithm

        public void setKeyFactoryPRFAlgorithm​(@NotNull
                                              PKCS5AlgorithmIdentifier keyFactoryPRFAlgorithm)
                                       throws CertException
        Specifies the algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password.
        Parameters:
        keyFactoryPRFAlgorithm - The algorithm identifier for the pseudorandom function to use when generating the encryption key from the provided password. It must not be null, and it must represent a valid pseudorandom function.
        Throws:
        CertException - If the provided algorithm identifier does not represent a valid pseudorandom function.
      • getKeyFactoryIterationCount

        public int getKeyFactoryIterationCount()
        Retrieves the iteration count to use when generating the encryption key from the provided password.
        Returns:
        The iteration count to use when generating the encryption key from the provided password.
      • setKeyFactoryIterationCount

        public void setKeyFactoryIterationCount​(int keyFactoryIterationCount)
        Specifies the iteration count to use when generating the encryption key from the provided password.
        Parameters:
        keyFactoryIterationCount - The iteration count to use when generating the encryption key from the provided password. It must be greater than zero.
      • getKeyFactorySaltLengthBytes

        public int getKeyFactorySaltLengthBytes()
        Retrieves the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
        Returns:
        The length in bytes to use for the key factory salt when generating the encryption key from the provided password.
      • setKeyFactorySaltLengthBytes

        public void setKeyFactorySaltLengthBytes​(int keyFactorySaltLengthBytes)
        Specifies the length in bytes to use for the key factory salt when generating the encryption key from the provided password.
        Parameters:
        keyFactorySaltLengthBytes - The length in bytes to use for the key factory salt when generating the encryption key from the provided password. It must be greater than zero.
      • getCipherTransformationAlgorithm

        @NotNull
        public PKCS5AlgorithmIdentifier getCipherTransformationAlgorithm()
        Retrieves the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
        Returns:
        The algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
      • setCipherTransformationAlgorithm

        public void setCipherTransformationAlgorithm​(@NotNull
                                                     PKCS5AlgorithmIdentifier cipherTransformationAlgorithm)
                                              throws CertException
        Specifies the algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key.
        Parameters:
        cipherTransformationAlgorithm - The algorithm identifier for the cipher transformation to use when encrypting a PKCS #8 private key. It must not be null, and it must represent a valid cipher transformation.
        Throws:
        CertException - If the provided algorithm identifier does not represent a valid cipher transformation.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of the PKCS #8 encryption properties.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the PKCS #8 encryption properties.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of the PKCS #8 encryption properties to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended. It must not be null.