Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnableToGetEncryptionKey is returned when Opener is not able to decrypt the encryption key. ErrUnableToGetEncryptionKey = errors.New("unable to get encryption key used to encrypt the message") // ErrUnableToParseSealerCert is returned if Opener is not able to parse the certificate sent by Sealer. ErrUnableToParseSealerCert = errors.New("unable to parse certificate used to seal message") // ErrUntrustedCert is returned if the certificate sent by the sealer is not trusted. ErrUntrustedCert = errors.New("sealer certificate is not trusted") // ErrInvalidSignature is returned if signature is not valid. ErrInvalidSignature = errors.New("invalid signature") // ErrUnableToDecryptPayload is returned if Opener is not able to decrypt payload. ErrUnableToDecryptPayload = errors.New("unable to decrypt payload") // ErrMessageExpired is returned when a message is past its expiration. ErrMessageExpired = errors.New("message is expired") )
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
SealerCert []byte `json:"sealerCert"`
Signature []byte `json:"signature"`
EncryptedKey []byte `json:"encryptedKey"`
Created string `json:"created"`
Expires string `json:"expires"`
}
Header is ...
type Opener ¶
type Opener struct {
PrivateKey *rsa.PrivateKey
CertPool *x509.CertPool
}
Opener is used to open a encrypted and signed message,
type Sealer ¶
type Sealer struct {
TimeToLive time.Duration
PrivateKey *rsa.PrivateKey
Cert *x509.Certificate
ReceiverCert *x509.Certificate
}
Sealer is used to encrypt and sign a message.
Click to show internal directories.
Click to hide internal directories.