Package org.pgpainless.policy
Class Policy
- java.lang.Object
-
- org.pgpainless.policy.Policy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Policy.CompressionAlgorithmPolicy
static class
Policy.HashAlgorithmPolicy
static class
Policy.PublicKeyAlgorithmPolicy
static class
Policy.SymmetricKeyAlgorithmPolicy
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Policy.CompressionAlgorithmPolicy
getCompressionAlgorithmPolicy()
static Policy
getInstance()
Return the singleton instance of PGPainless' policy.AlgorithmSuite
getKeyGenerationAlgorithmSuite()
Return the currentAlgorithmSuite
which defines preferred algorithms used during key generation.NotationRegistry
getNotationRegistry()
Return theNotationRegistry
of PGPainless.Policy.PublicKeyAlgorithmPolicy
getPublicKeyAlgorithmPolicy()
Return the current public key algorithm policy.Policy.HashAlgorithmPolicy
getRevocationSignatureHashAlgorithmPolicy()
Return the hash algorithm policy for revocations.Policy.HashAlgorithmPolicy
getSignatureHashAlgorithmPolicy()
Return the hash algorithm policy for signatures.Policy.SymmetricKeyAlgorithmPolicy
getSymmetricKeyDecryptionAlgorithmPolicy()
Return the symmetric encryption algorithm policy for decryption.Policy.SymmetricKeyAlgorithmPolicy
getSymmetricKeyEncryptionAlgorithmPolicy()
Return the symmetric encryption algorithm policy for encryption.void
setCompressionAlgorithmPolicy(Policy.CompressionAlgorithmPolicy policy)
void
setKeyGenerationAlgorithmSuite(AlgorithmSuite algorithmSuite)
Set a customAlgorithmSuite
which defines preferred algorithms used during key generation.void
setPublicKeyAlgorithmPolicy(Policy.PublicKeyAlgorithmPolicy publicKeyAlgorithmPolicy)
Set a custom public key algorithm policy.void
setRevocationSignatureHashAlgorithmPolicy(Policy.HashAlgorithmPolicy policy)
Set a custom hash algorithm policy for revocations.void
setSignatureHashAlgorithmPolicy(Policy.HashAlgorithmPolicy policy)
Set a custom hash algorithm policy for signatures.void
setSymmetricKeyDecryptionAlgorithmPolicy(Policy.SymmetricKeyAlgorithmPolicy policy)
Set a custom symmetric encryption algorithm policy for decrypting messages.void
setSymmetricKeyEncryptionAlgorithmPolicy(Policy.SymmetricKeyAlgorithmPolicy policy)
Set a custom symmetric encryption algorithm policy for encrypting messages.
-
-
-
Method Detail
-
getInstance
public static Policy getInstance()
Return the singleton instance of PGPainless' policy.- Returns:
- singleton instance
-
getSignatureHashAlgorithmPolicy
public Policy.HashAlgorithmPolicy getSignatureHashAlgorithmPolicy()
Return the hash algorithm policy for signatures.- Returns:
- hash algorithm policy
-
setSignatureHashAlgorithmPolicy
public void setSignatureHashAlgorithmPolicy(Policy.HashAlgorithmPolicy policy)
Set a custom hash algorithm policy for signatures.- Parameters:
policy
- custom policy
-
getRevocationSignatureHashAlgorithmPolicy
public Policy.HashAlgorithmPolicy getRevocationSignatureHashAlgorithmPolicy()
Return the hash algorithm policy for revocations. This policy is separate fromgetSignatureHashAlgorithmPolicy()
, as PGPainless by default uses a less strict policy when it comes to acceptable algorithms.- Returns:
- revocation signature hash algorithm policy
-
setRevocationSignatureHashAlgorithmPolicy
public void setRevocationSignatureHashAlgorithmPolicy(Policy.HashAlgorithmPolicy policy)
Set a custom hash algorithm policy for revocations.- Parameters:
policy
- custom policy
-
getSymmetricKeyEncryptionAlgorithmPolicy
public Policy.SymmetricKeyAlgorithmPolicy getSymmetricKeyEncryptionAlgorithmPolicy()
Return the symmetric encryption algorithm policy for encryption. This policy defines which symmetric algorithms are acceptable when producing encrypted messages.- Returns:
- symmetric algorithm policy for encryption
-
getSymmetricKeyDecryptionAlgorithmPolicy
public Policy.SymmetricKeyAlgorithmPolicy getSymmetricKeyDecryptionAlgorithmPolicy()
Return the symmetric encryption algorithm policy for decryption. This policy defines which symmetric algorithms are acceptable when decrypting encrypted messages.- Returns:
- symmetric algorithm policy for decryption
-
setSymmetricKeyEncryptionAlgorithmPolicy
public void setSymmetricKeyEncryptionAlgorithmPolicy(Policy.SymmetricKeyAlgorithmPolicy policy)
Set a custom symmetric encryption algorithm policy for encrypting messages.- Parameters:
policy
- custom policy
-
setSymmetricKeyDecryptionAlgorithmPolicy
public void setSymmetricKeyDecryptionAlgorithmPolicy(Policy.SymmetricKeyAlgorithmPolicy policy)
Set a custom symmetric encryption algorithm policy for decrypting messages.- Parameters:
policy
- custom policy
-
getCompressionAlgorithmPolicy
public Policy.CompressionAlgorithmPolicy getCompressionAlgorithmPolicy()
-
setCompressionAlgorithmPolicy
public void setCompressionAlgorithmPolicy(Policy.CompressionAlgorithmPolicy policy)
-
getPublicKeyAlgorithmPolicy
public Policy.PublicKeyAlgorithmPolicy getPublicKeyAlgorithmPolicy()
Return the current public key algorithm policy.- Returns:
- public key algorithm policy
-
setPublicKeyAlgorithmPolicy
public void setPublicKeyAlgorithmPolicy(Policy.PublicKeyAlgorithmPolicy publicKeyAlgorithmPolicy)
Set a custom public key algorithm policy.- Parameters:
publicKeyAlgorithmPolicy
- custom policy
-
getNotationRegistry
public NotationRegistry getNotationRegistry()
Return theNotationRegistry
of PGPainless. The notation registry is used to decide, whether a Notation is known or not. Background: Critical unknown notations render signatures invalid.- Returns:
- Notation registry
-
getKeyGenerationAlgorithmSuite
@Nonnull public AlgorithmSuite getKeyGenerationAlgorithmSuite()
Return the currentAlgorithmSuite
which defines preferred algorithms used during key generation.- Returns:
- current algorithm suite
-
setKeyGenerationAlgorithmSuite
public void setKeyGenerationAlgorithmSuite(@Nonnull AlgorithmSuite algorithmSuite)
Set a customAlgorithmSuite
which defines preferred algorithms used during key generation.- Parameters:
algorithmSuite
- custom algorithm suite
-
-