File: sign.go

package info (click to toggle)
golang-github-protonmail-gopenpgp-v3 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,028 kB
  • sloc: sh: 87; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 1,294 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package crypto

import "github.com/ProtonMail/go-crypto/openpgp/packet"

type SignProfile interface {
	SignConfig() *packet.Config
}

// PGPSign is an interface for creating signature messages with GopenPGP.
type PGPSign interface {
	// SigningWriter returns a wrapper around underlying output Writer,
	// such that any write-operation via the wrapper results in a write to a detached or inline signature message.
	// The encoding argument defines the output encoding, i.e., Bytes or Armored
	// Once close is called on the returned WriteCloser the final signature is written to the output.
	// Thus, the returned WriteCloser must be closed after the plaintext has been written.
	SigningWriter(output Writer, encoding int8) (WriteCloser, error)
	// Sign creates a detached or inline signature from the provided byte slice.
	// The encoding argument defines the output encoding, i.e., Bytes or Armored
	Sign(message []byte, encoding int8) ([]byte, error)
	// SignCleartext produces an armored cleartext message according to the specification.
	// Returns an armored message even if the PGPSign is not configured for armored output.
	SignCleartext(message []byte) ([]byte, error)
	// ClearPrivateParams clears all secret key material contained in the PGPSign from memory.
	ClearPrivateParams()
}