Documentation ¶
Overview ¶
Package crypto provides implementations of cryptographic algorithms used by KeyStore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyEncryptor ¶
type KeyEncryptor keystoreV1.KeyEncryptor
KeyEncryptor defines how KeyStore encrypts keys.
type KeyStoreSuite ¶
type KeyStoreSuite struct { KeyEncryptor KeyEncryptor SignatureAlgorithms []signature.Algorithm }
KeyStoreSuite defines cryptography used by KeyStore.
func NewSCellSuite ¶
func NewSCellSuite(encryptionKey, signatureKey []byte) (*KeyStoreSuite, error)
NewSCellSuite creates default cryptography suite for KeyStore: - keys are encrypted by Themis Secure Cell in Seal mode - keystore is signed with HMAC-SHA-256
func NewSCellSuiteWithEncryptor ¶
func NewSCellSuiteWithEncryptor(encryptor KeyEncryptor, signatureKey []byte) (*KeyStoreSuite, error)
NewSCellSuiteWithEncryptor creates default cryptography suite for KeyStore: - keys are encrypted by KeyEncryptor - keystore is signed with HMAC-SHA-256
type SignSha256 ¶
type SignSha256 struct {
// contains filtered or unexported fields
}
SignSha256 computes HMAC-SHA-256 signatures.
func NewSignSha256 ¶
func NewSignSha256(key []byte) (*SignSha256, error)
NewSignSha256 makes a new HMAC-SHA-256 signature computer keyed by given key.
func (*SignSha256) AlgorithmOID ¶
func (s *SignSha256) AlgorithmOID() encodingASN1.ObjectIdentifier
AlgorithmOID returns ASN.1 OID for this algorithm.
func (*SignSha256) Sign ¶
func (s *SignSha256) Sign(data, context []byte) []byte
Sign provided data in given context.
func (*SignSha256) Verify ¶
func (s *SignSha256) Verify(signature, data, context []byte) bool
Verify that signature matches data in given context.