Class KeyRingProtectionSettings


  • public class KeyRingProtectionSettings
    extends java.lang.Object
    Secret key protection settings for iterated and salted S2K.
    • Constructor Detail

      • KeyRingProtectionSettings

        public KeyRingProtectionSettings​(@Nonnull
                                         SymmetricKeyAlgorithm encryptionAlgorithm)
        Create a KeyRingProtectionSettings object using the given encryption algorithm, SHA1 and 65536 iterations.
        Parameters:
        encryptionAlgorithm - encryption algorithm
      • KeyRingProtectionSettings

        public KeyRingProtectionSettings​(@Nonnull
                                         SymmetricKeyAlgorithm encryptionAlgorithm,
                                         @Nonnull
                                         HashAlgorithm hashAlgorithm,
                                         int s2kCount)
        Constructor for custom salted and iterated S2K protection settings. The salt gets randomly chosen by the library each time. Note, that the s2kCount is the already encoded single-octet number.
        Parameters:
        encryptionAlgorithm - encryption algorithm
        hashAlgorithm - hash algorithm
        s2kCount - encoded s2k iteration count
        See Also:
        Encoding Formula
    • Method Detail

      • getEncryptionAlgorithm

        @Nonnull
        public SymmetricKeyAlgorithm getEncryptionAlgorithm()
        Return the encryption algorithm.
        Returns:
        encryption algorithm
      • getHashAlgorithm

        @Nonnull
        public HashAlgorithm getHashAlgorithm()
        Return the hash algorithm.
        Returns:
        hash algorithm
      • getS2kCount

        public int getS2kCount()
        Return the (encoded!) s2k iteration count.
        Returns:
        encoded s2k count
        See Also:
        Encoding Formula