Versions in this module Expand all Collapse all v0 v0.1.0 Feb 10, 2014 Changes in this version + const BestCompression + const BestSpeed + const DefaultCompression + const NoCompression + const SigTypeBinary + const SigTypeCasualCert + const SigTypeGenericCert + const SigTypePersonaCert + const SigTypePositiveCert + const SigTypeSubkeyBinding + 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 + Rand io.Reader + 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) Random() io.Reader + type EncryptedKey struct + Algo PublicKeyAlgorithm + CipherFunc CipherFunction + Key []byte + KeyId uint64 + func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) 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 NewRSAPrivateKey(currentTime time.Time, priv *rsa.PrivateKey) *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 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) (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, sig *Signature) (err error) + func (pk *PublicKey) VerifyUserIdSignatureV3(id string, 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, 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) + func (r *Reader) Unread(p Packet) + type Signature struct + CreationTime time.Time + DSASigR parsedMPI + DSASigS parsedMPI + ECDSASigR parsedMPI + ECDSASigS parsedMPI + FlagCertify bool + FlagEncryptCommunications bool + FlagEncryptStorage bool + FlagSign bool + FlagsValid bool + Hash crypto.Hash + HashSuffix []byte + HashTag [2]byte + IsPrimaryId *bool + IssuerKeyId *uint64 + KeyLifetimeSecs *uint32 + PreferredCompression []uint8 + PreferredHash []uint8 + PreferredSymmetric []uint8 + PubKeyAlgo PublicKeyAlgorithm + RSASignature parsedMPI + 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 + Encrypted bool + Key []byte + func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) 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