Versions in this module Expand all Collapse all v1 v1.0.0 May 15, 2019 Changes in this version + func EncryptCore(w io.Writer, encryptEntities []*openpgp.Entity, signEntity *openpgp.Entity, ...) (io.WriteCloser, error) + func SeparateKeyAndData(kr *KeyRing, r io.Reader, estimatedLength, garbageCollector int) (outSplit *models.EncryptedSplit, err error) + func SplitArmor(encrypted string) (*models.EncryptedSplit, error) + type AttachmentProcessor struct + func (ap *AttachmentProcessor) Finish() (*models.EncryptedSplit, error) + func (ap *AttachmentProcessor) Process(plainData []byte) + type GopenPGP struct + func GetGopenPGP() *GopenPGP + func (pgp *GopenPGP) BuildKeyRing(binKeys []byte) (kr *KeyRing, err error) + func (pgp *GopenPGP) BuildKeyRingArmored(key string) (kr *KeyRing, err error) + func (pgp *GopenPGP) BuildKeyRingNoError(binKeys []byte) (kr *KeyRing) + func (pgp *GopenPGP) CheckKey(pubKey string) (string, error) + func (pgp *GopenPGP) DecryptAttachment(keyPacket, dataPacket []byte, kr *KeyRing, passphrase string) ([]byte, error) + func (pgp *GopenPGP) DecryptMIMEMessage(encryptedText string, verifierKey, privateKeyRing *KeyRing, passphrase string, ...) + func (pgp *GopenPGP) DecryptMessage(encryptedText string, privateKey *KeyRing, passphrase string) (string, error) + func (pgp *GopenPGP) DecryptMessageStringKey(encryptedText, privateKey, passphrase string) (string, error) + func (pgp *GopenPGP) DecryptMessageVerify(encryptedText string, verifierKey, privateKeyRing *KeyRing, passphrase string, ...) (*models.DecryptSignedVerify, error) + func (pgp *GopenPGP) DecryptMessageWithPassword(encrypted string, password string) (string, error) + func (pgp *GopenPGP) EncryptAttachment(plainData []byte, fileName string, publicKey *KeyRing) (*models.EncryptedSplit, error) + func (pgp *GopenPGP) EncryptAttachmentLowMemory(estimatedSize int, fileName string, publicKey *KeyRing) (*AttachmentProcessor, error) + func (pgp *GopenPGP) EncryptMessage(plainText string, publicKey, privateKey *KeyRing, passphrase string, trim bool) (string, error) + func (pgp *GopenPGP) EncryptMessageWithPassword(plainText string, password string) (string, error) + func (pgp *GopenPGP) GenerateKey(userName, domain, passphrase, keyType string, bits int) (string, error) + func (pgp *GopenPGP) GenerateRSAKeyWithPrimes(userName, domain, passphrase string, bits int, ...) (string, error) + func (pgp *GopenPGP) GetSessionFromKeyPacket(keyPacket []byte, privateKey *KeyRing, passphrase string) (*SymmetricKey, error) + func (pgp *GopenPGP) GetSessionFromSymmetricPacket(keyPacket []byte, password string) (*SymmetricKey, error) + func (pgp *GopenPGP) GetTime() time.Time + func (pgp *GopenPGP) GetTimeUnix() int64 + func (pgp *GopenPGP) IsKeyExpired(publicKey string) (bool, error) + func (pgp *GopenPGP) IsKeyExpiredBin(publicKey []byte) (bool, error) + func (pgp *GopenPGP) KeyPacketWithPublicKey(sessionSplit *SymmetricKey, publicKey string) ([]byte, error) + func (pgp *GopenPGP) KeyPacketWithPublicKeyBin(sessionSplit *SymmetricKey, publicKey []byte) ([]byte, error) + func (pgp *GopenPGP) RandomToken() ([]byte, error) + func (pgp *GopenPGP) RandomTokenWith(size int) ([]byte, error) + func (pgp *GopenPGP) SymmetricKeyPacketWithPassword(sessionSplit *SymmetricKey, password string) ([]byte, error) + func (pgp *GopenPGP) UpdatePrivateKeyPassphrase(privateKey string, oldPassphrase string, newPassphrase string) (string, error) + func (pgp *GopenPGP) UpdateTime(newTime int64) + type Identity struct + Email string + Name string + type KeyRing struct + FirstKeyID string + func FilterExpiredKeys(contactKeys []*KeyRing) (filteredKeys []*KeyRing, err error) + func ReadArmoredKeyRing(r io.Reader) (kr *KeyRing, err error) + func ReadKeyRing(r io.Reader) (kr *KeyRing, err error) + func (kr *KeyRing) CheckPassphrase(passphrase string) bool + func (kr *KeyRing) Decrypt(r io.Reader) (decrypted io.Reader, signed *Signature, err error) + func (kr *KeyRing) DecryptArmored(r io.Reader) (decrypted io.Reader, signed *Signature, err error) + func (kr *KeyRing) DecryptMessage(encrypted string) (SignedString, error) + func (kr *KeyRing) DecryptMessageIfNeeded(data string) (decrypted string, err error) + func (kr *KeyRing) Encrypt(w io.Writer, sign *KeyRing, filename string, canonicalizeText bool) (io.WriteCloser, error) + func (kr *KeyRing) EncryptArmored(w io.Writer, sign *KeyRing) (wc io.WriteCloser, err error) + func (kr *KeyRing) EncryptKey(symKey *SymmetricKey) (packets string, err error) + func (kr *KeyRing) EncryptMessage(s string, sign *KeyRing) (encrypted string, err error) + func (kr *KeyRing) EncryptSymmetric(textToEncrypt string, canonicalizeText bool) (outSplit *models.EncryptedSplit, err error) + func (kr *KeyRing) GetArmoredPublicKey() (s string, err error) + func (kr *KeyRing) GetEntities() openpgp.EntityList + func (kr *KeyRing) GetFingerprint() (string, error) + func (kr *KeyRing) GetPublicKey() (b []byte, err error) + func (kr *KeyRing) GetSigningEntity(passphrase string) (*openpgp.Entity, error) + func (kr *KeyRing) Identities() []*Identity + func (kr *KeyRing) KeyIds() []uint64 + func (kr *KeyRing) SignBinDetached(plainData []byte, passphrase string) (string, error) + func (kr *KeyRing) SignTextDetached(plainText string, passphrase string, trimNewlines bool) (string, error) + func (kr *KeyRing) Unlock(passphrase []byte) error + func (kr *KeyRing) UnmarshalJSON(b []byte) (err error) + func (kr *KeyRing) VerifyBinDetachedSig(signature string, plainData []byte, verifyTime int64) (bool, error) + func (kr *KeyRing) VerifyTextDetachedSig(signature string, plainText string, verifyTime int64, trimNewlines bool) (bool, error) + func (kr *KeyRing) WriteArmoredPublicKey(w io.Writer) (err error) + func (kr *KeyRing) WritePublicKey(w io.Writer) (err error) + type MIMECallbacks interface + OnAttachment func(headers string, data []byte) + OnBody func(body string, mimetype string) + OnEncryptedHeaders func(headers string) + OnError func(err error) + OnVerified func(verified int) + type Signature struct + func (s *Signature) Err() error + func (s *Signature) IsBy(kr *KeyRing) bool + func (s *Signature) KeyRing() *KeyRing + type SignatureCollector struct + func (sc *SignatureCollector) Accept(part io.Reader, header textproto.MIMEHeader, ...) (err error) + func (sc SignatureCollector) GetSignature() string + type SignedString struct + Signed *Signature + String string + type SymmetricKey struct + Algo string + Key []byte + func DecryptAttKey(kr *KeyRing, keyPacket string) (key *SymmetricKey, err error) + func (sk *SymmetricKey) GetBase64Key() string + func (sk *SymmetricKey) GetCipherFunc() packet.CipherFunction