profile

package
v3.1.1-proton Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 4 Imported by: 5

Documentation

Overview

Package profile provides different profiles to run GopenPGP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom struct {
	// SetKeyAlgorithm is a function that sets public key encryption
	// algorithm in the config bases on the int8 security level.
	SetKeyAlgorithm func(*packet.Config, int8)
	// AeadKeyEncryption defines the aead encryption algorithm for key encryption.
	AeadKeyEncryption *packet.AEADConfig
	// S2kKeyEncryption defines the s2k algorithm for key encryption.
	S2kKeyEncryption *s2k.Config
	// AeadEncryption defines the aead encryption algorithm for pgp encryption.
	// If nil, aead is disabled even if the key supports it.
	AeadEncryption *packet.AEADConfig
	// KeyGenAeadEncryption defines if the output key in key generation
	// advertises SEIPDv2 and aead algorithms in its key preferences.
	// If nil, uses AeadEncryption as key preferences.
	KeyGenAeadEncryption *packet.AEADConfig
	// S2kEncryption defines the s2k algorithm for pgp encryption.
	S2kEncryption *s2k.Config
	// CompressionConfiguration defines the compression configuration to be used if any.
	CompressionConfiguration *packet.CompressionConfig
	// Hash defines hash algorithm to be used.
	Hash crypto.Hash
	// SignHash defines if a different hash algorithm should be used for signing.
	// If nil, the a above field Hash is used.
	SignHash *crypto.Hash
	// CipherKeyEncryption defines the cipher to be used for key encryption.
	CipherKeyEncryption packet.CipherFunction
	// CipherEncryption defines the cipher to be used for pgp message encryption.
	CipherEncryption packet.CipherFunction
	// CompressionAlgorithm defines the compression algorithm to be used if any.
	CompressionAlgorithm packet.CompressionAlgo
	// V6 is a flag to indicate if v6 from the crypto-refresh should be used.
	V6 bool
	// AllowAllPublicKeyAlgorithms is a flag to disable all checks for deprecated public key algorithms.
	AllowAllPublicKeyAlgorithms bool
	// DisableIntendedRecipients is a flag to disable the intended recipients pgp feature from the crypto-refresh.
	DisableIntendedRecipients bool
	// InsecureAllowWeakRSA is a flag to disable checks for weak rsa keys.
	InsecureAllowWeakRSA bool
	// InsecureAllowDecryptionWithSigningKeys is a flag to enable to decrypt with signing keys for compatibility reasons.
	InsecureAllowDecryptionWithSigningKeys bool
}

Custom type represents a profile for setting algorithm parameters for generating keys, encrypting data, and signing data. Use one of the pre-defined profiles if possible. i.e., profile.Default(), profile.RFC4880().

func Default

func Default() *Custom

Default returns a custom profile that support features that are widely implemented.

func PQC

func PQC() *Custom

func ProtonV1

func ProtonV1() *Custom

ProtonV1 is the version 1 profile used in proton clients.

func RFC4880

func RFC4880() *Custom

RFC4880 returns a custom profile for this library that conforms with the algorithms in RFC4880.

func RFC9580

func RFC9580() *Custom

RFC9580 returns a custom profile for this library that conforms with the algorithms in RFC9580.

func Symmetric

func Symmetric() *Custom

func (*Custom) CompressionConfig

func (p *Custom) CompressionConfig() *packet.Config

func (*Custom) EncryptionConfig

func (p *Custom) EncryptionConfig() *packet.Config

func (*Custom) KeyEncryptionConfig

func (p *Custom) KeyEncryptionConfig() *packet.Config

func (*Custom) KeyGenerationConfig

func (p *Custom) KeyGenerationConfig(securityLevel int8) *packet.Config

func (*Custom) SignConfig

func (p *Custom) SignConfig() *packet.Config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL