Versions in this module Expand all Collapse all v1 v1.8.0 Sep 21, 2018 v1.6.7 Feb 27, 2018 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 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 SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, key []byte, config *Config) (contents io.WriteCloser, err error) + type CipherFunction uint8 + 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 + CompressionConfig *CompressionConfig + DefaultCipher CipherFunction + DefaultCompressionAlgo CompressionAlgo + DefaultHash crypto.Hash + RSABits int + Rand io.Reader + S2KCount int + Time func() time.Time + func (c *Config) Cipher() CipherFunction + func (c *Config) Compression() CompressionAlgo + func (c *Config) Hash() crypto.Hash + func (c *Config) Now() time.Time + func (c *Config) PasswordHashIterations() int + func (c *Config) Random() io.Reader + 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 + 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(currentTime time.Time, priv *dsa.PrivateKey) *PrivateKey + func NewECDSAPrivateKey(currentTime time.Time, priv *ecdsa.PrivateKey) *PrivateKey + func NewElGamalPrivateKey(currentTime time.Time, priv *elgamal.PrivateKey) *PrivateKey + func NewRSAPrivateKey(currentTime time.Time, priv *rsa.PrivateKey) *PrivateKey + func NewSignerPrivateKey(currentTime time.Time, signer crypto.Signer) *PrivateKey + func (pk *PrivateKey) Decrypt(passphrase []byte) error + func (pk *PrivateKey) Serialize(w io.Writer) (err error) + type PublicKey struct + CreationTime time.Time + Fingerprint [20]byte + IsSubkey bool + KeyId uint64 + PubKeyAlgo PublicKeyAlgorithm + PublicKey interface{} + func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey + func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.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) KeyIdShortString() string + func (pk *PublicKey) KeyIdString() string + func (pk *PublicKey) Serialize(w io.Writer) (err error) + func (pk *PublicKey) SerializeSignaturePrefix(h io.Writer) + 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) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) + func (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) + func (pk *PublicKey) VerifyUserIdSignatureV3(id string, pub *PublicKey, sig *SignatureV3) (err error) + type PublicKeyAlgorithm uint8 + const PubKeyAlgoDSA + const PubKeyAlgoECDH + const PubKeyAlgoECDSA + const PubKeyAlgoElGamal + const PubKeyAlgoRSA + const PubKeyAlgoRSAEncryptOnly + const PubKeyAlgoRSASignOnly + func (pka PublicKeyAlgorithm) CanEncrypt() bool + func (pka PublicKeyAlgorithm) CanSign() bool + type PublicKeyV3 struct + CreationTime time.Time + DaysToExpire uint16 + Fingerprint [16]byte + IsSubkey bool + KeyId uint64 + PubKeyAlgo PublicKeyAlgorithm + PublicKey *rsa.PublicKey + func (pk *PublicKeyV3) BitLength() (bitLength uint16, err error) + func (pk *PublicKeyV3) CanSign() bool + func (pk *PublicKeyV3) KeyIdShortString() string + func (pk *PublicKeyV3) KeyIdString() string + func (pk *PublicKeyV3) Serialize(w io.Writer) (err error) + func (pk *PublicKeyV3) SerializeSignaturePrefix(w io.Writer) + func (pk *PublicKeyV3) VerifyKeySignatureV3(signed *PublicKeyV3, sig *SignatureV3) (err error) + func (pk *PublicKeyV3) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) + func (pk *PublicKeyV3) VerifyUserIdSignatureV3(id string, pub *PublicKeyV3, sig *SignatureV3) (err error) + 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 Signature struct + CreationTime time.Time + DSASigR parsedMPI + DSASigS parsedMPI + ECDSASigR parsedMPI + ECDSASigS parsedMPI + EmbeddedSignature *Signature + FlagCertify bool + FlagEncryptCommunications bool + FlagEncryptStorage bool + FlagSign bool + FlagsValid bool + Hash crypto.Hash + HashSuffix []byte + HashTag [2]byte + IsPrimaryId *bool + IssuerKeyId *uint64 + KeyLifetimeSecs *uint32 + MDC bool + PreferredCompression []uint8 + PreferredHash []uint8 + PreferredSymmetric []uint8 + PubKeyAlgo PublicKeyAlgorithm + RSASignature parsedMPI + RevocationReason *uint8 + RevocationReasonText string + SigLifetimeSecs *uint32 + SigType SignatureType + func (sig *Signature) KeyExpired(currentTime time.Time) bool + func (sig *Signature) Serialize(w io.Writer) (err error) + 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 SignatureV3 struct + CreationTime time.Time + DSASigR parsedMPI + DSASigS parsedMPI + Hash crypto.Hash + HashTag [2]byte + IssuerKeyId uint64 + PubKeyAlgo PublicKeyAlgorithm + RSASignature parsedMPI + SigType SignatureType + func (sig *SignatureV3) Serialize(w io.Writer) (err error) + type SymmetricKeyEncrypted struct + CipherFunc CipherFunction + func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunction, error) + type SymmetricallyEncrypted struct + 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