Documentation ¶
Index ¶
- Variables
- func MarshalKey(k *openpgp.Entity) ([]byte, error)
- type GPG
- func (gpg *GPG) CheckMessageSignature(message io.Reader, signature io.Reader, checkedSignerKey Key) error
- func (gpg *GPG) DecryptMessage(message io.Reader) (io.Reader, error)
- func (gpg *GPG) DecryptSignedMessage(message io.Reader, output io.Writer, senderPublicKey Key) error
- func (gpg *GPG) EncryptMessage(output io.Writer, recipient Key) (plaintext io.WriteCloser, err error)
- func (gpg *GPG) ReadKey(r io.Reader) (Key, error)
- func (gpg *GPG) ServerIdentity() string
- func (gpg *GPG) SignMessage(message io.Reader, w io.Writer) error
- func (gpg *GPG) SignUserID(signedEMail string, pubkey Key, w io.Writer) error
- type Key
Constants ¶
This section is empty.
Variables ¶
var ErrMessageNotEncrypted = errors.New("gpg: Message not encrypted")
ErrMessageNotEncrypted is returned when to be decrypted message is not encrypted.
var ErrMessageNotSigned = errors.New("gpg: Message not signed")
ErrMessageNotSigned is returned when to be decrypted message was not signed by anybody.
var ErrNoPrivateKey = errors.New("gpg: Entity contains no private key to decrypt")
ErrNoPrivateKey is returned when an entity does not contain needed private keys.
var ErrUnknownIdentity = errors.New("gpg: Identity not associated with client key")
ErrUnknownIdentity is returned when an identity could not be found within the identities of a key.
var ErrUnknownIssuer = openpgpErrors.ErrUnknownIssuer
ErrUnknownIssuer is returned when the issuer of a signature is not known.
Functions ¶
Types ¶
type GPG ¶
type GPG struct {
// contains filtered or unexported fields
}
GPG contains the data necessary to perform our cryptographical actions, but hides the private key.
func (*GPG) CheckMessageSignature ¶
func (gpg *GPG) CheckMessageSignature(message io.Reader, signature io.Reader, checkedSignerKey Key) error
CheckMessageSignature checks whether an armored detached signature is valid for a given message and has been made by the given signer.
func (*GPG) DecryptMessage ¶
DecryptMessage decrypts an encrypted message sent to server, but does not check the signature. It writes the plain text to the output
func (*GPG) DecryptSignedMessage ¶
func (gpg *GPG) DecryptSignedMessage(message io.Reader, output io.Writer, senderPublicKey Key) error
DecryptSignedMessage decrypts an encrypted message sent to server, checks the (mandatory) embedded signature made by the given sender and write the plain text to output.
func (*GPG) EncryptMessage ¶
func (gpg *GPG) EncryptMessage(output io.Writer, recipient Key) (plaintext io.WriteCloser, err error)
EncryptMessage encrypts a message using the server's entity for the given recipient and writes the cipher text to output.
func (*GPG) ServerIdentity ¶
ServerIdentity returns the full identity string for the server key in use
func (*GPG) SignMessage ¶
SignMessage signs message and writes the armored detached signature to w.