Documentation ¶
Index ¶
- func DecryptIntoJSON(dec tink.HybridDecrypt, ciphertext string, target interface{}) error
- func DecryptString(dec tink.HybridDecrypt, data string) (string, error)
- func EncryptJSON(enc tink.HybridEncrypt, data interface{}) (string, error)
- func EncryptString(enc tink.HybridEncrypt, data string) (string, error)
- func Pack(payload interface{}, keys *orckeys.Keys, registry PublicKeyRegistry, ...) (string, error)
- func PackUnencrypted(payload interface{}, keys *orckeys.Keys) (string, error)
- func SignJSON(sgn tink.Signer, data interface{}) (string, error)
- func SignString(sgn tink.Signer, data string) (string, error)
- func VerifyJSON(data interface{}, signature, publicKey string) (bool, error)
- func VerifyString(data, sig, publicKey string) (bool, error)
- type Contents
- type Packet
- func PackUnencryptedJSON(payload interface{}, keys *orckeys.Keys) (*Packet, error)
- func Unpack(target interface{}, ciphertext string, keys *orckeys.Keys, ...) (*Packet, error)
- func UnpackUnencrypted(target interface{}, plaintext string, registry PublicKeyRegistry) (*Packet, error)
- func UnpackWithoutVerification(target interface{}, ciphertext string, keys *orckeys.Keys) (*Packet, error)
- type PublicKeyRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptIntoJSON ¶
func DecryptIntoJSON(dec tink.HybridDecrypt, ciphertext string, target interface{}) error
func DecryptString ¶
func DecryptString(dec tink.HybridDecrypt, data string) (string, error)
func EncryptJSON ¶
func EncryptJSON(enc tink.HybridEncrypt, data interface{}) (string, error)
func EncryptString ¶
func EncryptString(enc tink.HybridEncrypt, data string) (string, error)
func PackUnencrypted ¶
func VerifyJSON ¶
func VerifyString ¶
Types ¶
type Contents ¶
type Contents struct { // Timestamp is the timestamp of when the packet was wrapped. Timestamp string `json:"timestamp"` // Recipient is the canonical host of the recipient, to whom the message is encrypted. Recipient string `json:"recipient,omitempty"` // Sender is the canonical host of the sender. Sender string `json:"sender"` // Payload is the message contained in the packet. Payload interface{} `json:"payload"` }
type Packet ¶
type Packet struct { // Contents is the contents of the packet; the data to be signed. Contents Contents `json:"contents"` // Signature is the signature of the canonical JSON form of Contents, with the signing key associated with Contents.Sender. Signature string `json:"signature"` }
func PackUnencryptedJSON ¶
func UnpackUnencrypted ¶
func UnpackUnencrypted(target interface{}, plaintext string, registry PublicKeyRegistry) (*Packet, error)
type PublicKeyRegistry ¶
type PublicKeyRegistry interface {
LookupPublicKeys(string) (*orckeys.PublicKeyPacket, error)
}
Click to show internal directories.
Click to hide internal directories.