Documentation ¶
Index ¶
- Variables
- func Decrypt(label []byte, encryptedMsg *EncryptedMessage, privateKey *rsa.PrivateKey, ...) (err error)
- type EncryptedMessage
- func (*EncryptedMessage) Descriptor() ([]byte, []int)
- func (m *EncryptedMessage) GetDecryptionKeyId() []byte
- func (m *EncryptedMessage) GetDigest() []byte
- func (m *EncryptedMessage) GetSignature() []byte
- func (m *EncryptedMessage) GetVerificationKeyId() []byte
- func (*EncryptedMessage) ProtoMessage()
- func (m *EncryptedMessage) Reset()
- func (m *EncryptedMessage) String() string
- func (m *EncryptedMessage) XXX_DiscardUnknown()
- func (m *EncryptedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncryptedMessage) XXX_Merge(src proto.Message)
- func (m *EncryptedMessage) XXX_Size() int
- func (m *EncryptedMessage) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Hash = crypto.SHA256
Allow the developer to change the hash function
Allow the developer to take logging
View Source
var Sign = crypto.SHA512_256
Allow the developer to change the signing function
Functions ¶
Types ¶
type EncryptedMessage ¶
type EncryptedMessage struct { Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` Digest []byte `protobuf:"bytes,3,opt,name=digest,proto3" json:"digest,omitempty"` VerificationKeyId []byte `protobuf:"bytes,8,opt,name=verificationKeyId,proto3" json:"verificationKeyId,omitempty"` DecryptionKeyId []byte `protobuf:"bytes,9,opt,name=decryptionKeyId,proto3" json:"decryptionKeyId,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func Encrypt ¶
func Encrypt(label []byte, message proto.Message, publicKey *rsa.PublicKey, privateKeyForSig *rsa.PrivateKey) (encMsg *EncryptedMessage, err error)
Encrypt a protocol buffer 'message' with the given label using the given public key
func (*EncryptedMessage) Descriptor ¶
func (*EncryptedMessage) Descriptor() ([]byte, []int)
func (*EncryptedMessage) GetDecryptionKeyId ¶
func (m *EncryptedMessage) GetDecryptionKeyId() []byte
func (*EncryptedMessage) GetDigest ¶
func (m *EncryptedMessage) GetDigest() []byte
func (*EncryptedMessage) GetSignature ¶
func (m *EncryptedMessage) GetSignature() []byte
func (*EncryptedMessage) GetVerificationKeyId ¶
func (m *EncryptedMessage) GetVerificationKeyId() []byte
func (*EncryptedMessage) ProtoMessage ¶
func (*EncryptedMessage) ProtoMessage()
func (*EncryptedMessage) Reset ¶
func (m *EncryptedMessage) Reset()
func (*EncryptedMessage) String ¶
func (m *EncryptedMessage) String() string
func (*EncryptedMessage) XXX_DiscardUnknown ¶
func (m *EncryptedMessage) XXX_DiscardUnknown()
func (*EncryptedMessage) XXX_Marshal ¶
func (m *EncryptedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncryptedMessage) XXX_Merge ¶
func (m *EncryptedMessage) XXX_Merge(src proto.Message)
func (*EncryptedMessage) XXX_Size ¶
func (m *EncryptedMessage) XXX_Size() int
func (*EncryptedMessage) XXX_Unmarshal ¶
func (m *EncryptedMessage) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.