Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envelope ¶
Envelope wraps a SecureEnvelope containing all of the information necessary to access the payload data. The envelope can be edited and resealed to simplify TRISA exchanges.
func New ¶
New creates a new envelope, generating an ID if the ID is empty and creating a new AES-GCM cipher if the cipher is nil.
func Open ¶
func Open(in *protocol.SecureEnvelope, key interface{}) (_ *Envelope, err error)
Open a secure envelope using the private signing key paired with the public key that was used to encrypt the symmetric payload encryption key. The open method decrypts the payload key, then decrypts and verifies the payload data using the algorithm information stored in the envelope. It returns a data structure with discovered cipher and decrypted Payload for access. On error returns *protocol.Error so that the error can be directly returned to the client.
func (*Envelope) Seal ¶
func (e *Envelope) Seal(key interface{}) (out *protocol.SecureEnvelope, err error)
Seal an envelope using the public signing key of the TRISA peer. The envelope uses the internal Cipher to encrypt the Payload then encrypts the keys in the Cipher with the public key. On error returns *protocol.Error so that the error can be directly returned to the client.