Versions in this module Expand all Collapse all v1 v1.0.0 Nov 16, 2020 Changes in this version + const BestCompression + const BestSpeed + const DefaultCompression + const KeyFlagCertify + const KeyFlagEncryptCommunications + const KeyFlagEncryptStorage + const KeyFlagSign + const NoCompression + const SigTypeBinary + const SigTypeCasualCert + const SigTypeDirectSignature + const SigTypeGenericCert + const SigTypeKeyRevocation + const SigTypePersonaCert + const SigTypePositiveCert + const SigTypePrimaryKeyBinding + const SigTypeSubkeyBinding + const SigTypeSubkeyRevocation + const SigTypeText + const UserAttrImageSubpacket + func NewOCFBDecrypter(block cipher.Block, prefix []byte, resync OCFBResyncOption) cipher.Stream + func NewOCFBEncrypter(block cipher.Block, randData []byte, resync OCFBResyncOption) (cipher.Stream, []byte) + func SerializeAEADEncrypted(w io.Writer, key []byte, cipher CipherFunction, mode AEADMode, config *Config) (io.WriteCloser, error) + func SerializeCompressed(w io.WriteCloser, algo CompressionAlgo, cc *CompressionConfig) (literaldata io.WriteCloser, err error) + func SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, ...) error + func SerializeLiteral(w io.WriteCloser, isBinary bool, fileName string, time uint32) (plaintext io.WriteCloser, err error) + func SerializeSymmetricKeyEncrypted(w io.Writer, passphrase []byte, config *Config) (key []byte, err error) + func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, passphrase []byte, config *Config) (err error) + func SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, key []byte, config *Config) (Contents io.WriteCloser, err error) + type AEADConfig struct + ChunkSize uint64 + DefaultMode AEADMode + func (conf *AEADConfig) ChunkSizeByte() byte + func (conf *AEADConfig) Mode() AEADMode + type AEADEncrypted struct + Contents io.Reader + func (ae *AEADEncrypted) Decrypt(ciph CipherFunction, key []byte) (io.ReadCloser, error) + type AEADMode algorithm.AEADMode + const AEADModeEAX + const AEADModeExperimentalGCM + const AEADModeOCB + func (mode AEADMode) NonceLength() int + func (mode AEADMode) TagLength() int + type CipherFunction algorithm.CipherFunction + const Cipher3DES + const CipherAES128 + const CipherAES192 + const CipherAES256 + const CipherCAST5 + func (cipher CipherFunction) KeySize() int + type Compressed struct + Body io.Reader + type CompressionAlgo uint8 + const CompressionNone + const CompressionZIP + const CompressionZLIB + type CompressionConfig struct + Level int + type Config struct + AEADConfig *AEADConfig + Algorithm PublicKeyAlgorithm + CompressionConfig *CompressionConfig + DefaultCipher CipherFunction + DefaultCompressionAlgo CompressionAlgo + DefaultHash crypto.Hash + KeyLifetimeSecs uint32 + RSABits int + RSAPrimes []*big.Int + Rand io.Reader + S2KCount int + SigLifetimeSecs uint32 + Time func() time.Time + V5Keys bool + func (c *Config) AEAD() *AEADConfig + func (c *Config) Cipher() CipherFunction + func (c *Config) Compression() CompressionAlgo + func (c *Config) Hash() crypto.Hash + func (c *Config) KeyLifetime() uint32 + func (c *Config) Now() time.Time + func (c *Config) PasswordHashIterations() int + func (c *Config) PublicKeyAlgorithm() PublicKeyAlgorithm + func (c *Config) RSAModulusBits() int + func (c *Config) Random() io.Reader + func (c *Config) SigLifetime() uint32 + type EncryptedDataPacket interface + Decrypt func(CipherFunction, []byte) (io.ReadCloser, error) + type EncryptedKey struct + Algo PublicKeyAlgorithm + CipherFunc CipherFunction + Key []byte + KeyId uint64 + func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error + func (e *EncryptedKey) Serialize(w io.Writer) error + type LiteralData struct + Body io.Reader + FileName string + Format uint8 + IsBinary bool + Time uint32 + func (l *LiteralData) ForEyesOnly() bool + type OCFBResyncOption bool + const OCFBNoResync + const OCFBResync + type OnePassSignature struct + Hash crypto.Hash + IsLast bool + KeyId uint64 + PubKeyAlgo PublicKeyAlgorithm + SigType SignatureType + func (ops *OnePassSignature) Serialize(w io.Writer) error + type OpaquePacket struct + Contents []byte + Reason error + Tag uint8 + func (op *OpaquePacket) Parse() (p Packet, err error) + func (op *OpaquePacket) Serialize(w io.Writer) (err error) + type OpaqueReader struct + func NewOpaqueReader(r io.Reader) *OpaqueReader + func (or *OpaqueReader) Next() (op *OpaquePacket, err error) + type OpaqueSubpacket struct + Contents []byte + SubType uint8 + func OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) + func (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) + type Packet interface + func Read(r io.Reader) (p Packet, err error) + type PrivateKey struct + Encrypted bool + PrivateKey interface{} + func NewDSAPrivateKey(creationTime time.Time, priv *dsa.PrivateKey) *PrivateKey + func NewDecrypterPrivateKey(creationTime time.Time, decrypter interface{}) *PrivateKey + func NewECDHPrivateKey(creationTime time.Time, priv *ecdh.PrivateKey) *PrivateKey + func NewECDSAPrivateKey(creationTime time.Time, priv *ecdsa.PrivateKey) *PrivateKey + func NewEdDSAPrivateKey(creationTime time.Time, priv *ed25519.PrivateKey) *PrivateKey + func NewElGamalPrivateKey(creationTime time.Time, priv *elgamal.PrivateKey) *PrivateKey + func NewRSAPrivateKey(creationTime time.Time, priv *rsa.PrivateKey) *PrivateKey + func NewSignerPrivateKey(creationTime time.Time, signer crypto.Signer) *PrivateKey + func (pk *PrivateKey) Decrypt(passphrase []byte) error + func (pk *PrivateKey) Dummy() bool + func (pk *PrivateKey) Encrypt(passphrase []byte) error + func (pk *PrivateKey) Serialize(w io.Writer) (err error) + type PublicKey struct + CreationTime time.Time + Fingerprint []byte + IsSubkey bool + KeyId uint64 + PubKeyAlgo PublicKeyAlgorithm + PublicKey interface{} + Version int + func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey + func NewECDHPublicKey(creationTime time.Time, pub *ecdh.PublicKey) *PublicKey + func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey + func NewEdDSAPublicKey(creationTime time.Time, pub *ed25519.PublicKey) *PublicKey + func NewElGamalPublicKey(creationTime time.Time, pub *elgamal.PublicKey) *PublicKey + func NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey + func (pk *PublicKey) BitLength() (bitLength uint16, err error) + func (pk *PublicKey) CanSign() bool + func (pk *PublicKey) KeyExpired(sig *Signature, currentTime time.Time) bool + func (pk *PublicKey) KeyIdShortString() string + func (pk *PublicKey) KeyIdString() string + func (pk *PublicKey) Serialize(w io.Writer) (err error) + func (pk *PublicKey) SerializeForHash(w io.Writer) error + func (pk *PublicKey) SerializeSignaturePrefix(w io.Writer) + func (pk *PublicKey) UpgradeToV5() + func (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) error + func (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) + func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err error) + func (pk *PublicKey) VerifySubkeyRevocationSignature(sig *Signature, signingKey *PublicKey) (err error) + func (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) + type PublicKeyAlgorithm uint8 + const PubKeyAlgoDSA + const PubKeyAlgoECDH + const PubKeyAlgoECDSA + const PubKeyAlgoEdDSA + const PubKeyAlgoElGamal + const PubKeyAlgoRSA + const PubKeyAlgoRSAEncryptOnly + const PubKeyAlgoRSASignOnly + func (pka PublicKeyAlgorithm) CanEncrypt() bool + func (pka PublicKeyAlgorithm) CanSign() bool + type Reader struct + func NewReader(r io.Reader) *Reader + func (r *Reader) Next() (p Packet, err error) + func (r *Reader) Push(reader io.Reader) (err error) + func (r *Reader) Unread(p Packet) + type ReasonForRevocation uint8 + const KeyCompromised + const KeyRetired + const KeySuperseded + const NoReason + type S2KType uint8 + const S2KCHECKSUM + const S2KNON + const S2KSHA1 + type Signature struct + AEAD bool + CreationTime time.Time + DSASigR encoding.Field + DSASigS encoding.Field + ECDSASigR encoding.Field + ECDSASigS encoding.Field + EdDSASigR encoding.Field + EdDSASigS encoding.Field + EmbeddedSignature *Signature + FlagCertify bool + FlagEncryptCommunications bool + FlagEncryptStorage bool + FlagSign bool + FlagsValid bool + Hash crypto.Hash + HashSuffix []byte + HashTag [2]byte + IsPrimaryId *bool + IssuerFingerprint []byte + IssuerKeyId *uint64 + KeyLifetimeSecs *uint32 + MDC bool + Metadata *LiteralData + PreferredAEAD []uint8 + PreferredCompression []uint8 + PreferredHash []uint8 + PreferredSymmetric []uint8 + PubKeyAlgo PublicKeyAlgorithm + RSASignature encoding.Field + RevocationReason *uint8 + RevocationReasonText string + SigLifetimeSecs *uint32 + SigType SignatureType + V5Keys bool + Version int + func (sig *Signature) AddMetadataToHashSuffix() + func (sig *Signature) CheckKeyIdOrFingerprint(pk *PublicKey) bool + func (sig *Signature) CrossSignKey(pub *PublicKey, hashKey *PublicKey, signingKey *PrivateKey, config *Config) error + func (sig *Signature) RevokeKey(pub *PublicKey, priv *PrivateKey, config *Config) error + func (sig *Signature) Serialize(w io.Writer) (err error) + func (sig *Signature) SigExpired(currentTime time.Time) bool + func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) + func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error + func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error + type SignatureType uint8 + type SymmetricKeyEncrypted struct + CipherFunc CipherFunction + Mode AEADMode + Version int + func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunction, error) + type SymmetricallyEncrypted struct + Contents io.Reader + MDC bool + func (se *SymmetricallyEncrypted) Decrypt(c CipherFunction, key []byte) (io.ReadCloser, error) + type UserAttribute struct + Contents []*OpaqueSubpacket + func NewUserAttribute(contents ...*OpaqueSubpacket) *UserAttribute + func NewUserAttributePhoto(photos ...image.Image) (uat *UserAttribute, err error) + func (uat *UserAttribute) ImageData() (imageData [][]byte) + func (uat *UserAttribute) Serialize(w io.Writer) (err error) + type UserId struct + Comment string + Email string + Id string + Name string + func NewUserId(name, comment, email string) *UserId + func (uid *UserId) Serialize(w io.Writer) error