Documentation
¶
Overview ¶
Package crypto contains the Crypto interface to be used by the framework. It will be created via Options creation in pkg/framework/context.Provider. BBS+ signature scheme is not included in the main Crypto interface. It is defined separately under the primitive sub-package including its implementation which should not be referenced directly. It is accessible via the framework's KMS BBS+ keys and tinkcrypto's bbs package's Signer and Verifier primitives or via webkms for remote KMS BBS+ signing.
Index ¶
Constants ¶
const DefKeySize = crypto.DefKeySize
DefKeySize is the default key size for crypto primitives.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrivateKey ¶ added in v0.1.7
type PrivateKey = cryptoapi.PrivateKey
PrivateKey mainly used to exchange ephemeral private key in JWE encrypter.
type RecipientWrappedKey ¶ added in v0.1.5
type RecipientWrappedKey = cryptoapi.RecipientWrappedKey
RecipientWrappedKey contains recipient key material required to unwrap CEK.
type WrapKeyOpts ¶ added in v0.1.5
type WrapKeyOpts = cryptoapi.WrapKeyOpts
WrapKeyOpts are the crypto.Wrap key options.
func WithEPK ¶ added in v0.1.7
func WithEPK(epk *PrivateKey) WrapKeyOpts
WithEPK option is to instruct the key wrapping function of the ephemeral key to be used in the wrapping process. It is mainly used for ECDH-1PU during KDF. This option allows passing a predefined EPK instead of generating a new one when wrapping. It is useful for Wrap() call only since Unwrap() already uses a predefined EPK. The absence of this option means a new EPK will be generated internally.
func WithSender ¶ added in v0.1.5
func WithSender(senderKey interface{}) WrapKeyOpts
WithSender option is for setting a sender key with crypto wrapping (eg: AuthCrypt). For Anoncrypt, this option must not be set. Sender is a key used for ECDH-1PU key agreement for authenticating the sender. senderkey can be of the following there types:
- *keyset.Handle (requires private key handle for crypto.WrapKey())
- *crypto.PublicKey (available for UnwrapKey() only)
- *ecdsa.PublicKey (available for UnwrapKey() only)
func WithTag ¶ added in v0.1.7
func WithTag(tag []byte) WrapKeyOpts
WithTag option is to instruct the key wrapping function of the authentication tag to be used in the wrapping process. It is mainly used with CBC+HMAC content encryption to authenticate the sender of an encrypted JWE message (ie authcrypt/ECDH-1PU). The absence of this option means the sender's identity is not revealed (ie anoncrypt/ECDH-ES).
func WithXC20PKW ¶ added in v0.1.6
func WithXC20PKW() WrapKeyOpts
WithXC20PKW option is a flag option for crypto wrapping. When used, key wrapping will use XChacha20Poly1305 encryption as key wrapping. The absence of this option (default) uses AES256-GCM encryption as key wrapping. The KDF used in the crypto wrapping function is selected based on the type of recipient key argument of KeyWrap(), it is independent of this option.
Directories
¶
Path | Synopsis |
---|---|
primitive
|
|
bbs12381g2pub
Package bbs12381g2pub contains BBS+ signing primitives and keys.
|
Package bbs12381g2pub contains BBS+ signing primitives and keys. |
Package tinkcrypto provides the default implementation of the common pkg/common/api/crypto.Crypto interface and the SPI pkg/framework/aries.crypto interface
|
Package tinkcrypto provides the default implementation of the common pkg/common/api/crypto.Crypto interface and the SPI pkg/framework/aries.crypto interface |
primitive/aead
Package aead provides implementations of the AEAD primitive.
|
Package aead provides implementations of the AEAD primitive. |
primitive/aead/subtle
Package subtle provides subtle implementations of the AEAD primitive.
|
Package subtle provides subtle implementations of the AEAD primitive. |
primitive/bbs
Package bbs provides implementations of BBS+ key management and primitives.
|
Package bbs provides implementations of BBS+ key management and primitives. |
primitive/composite
Package composite provides the core crypto composite primitives such as ECDH-ES and ECDH-1PU to be used by JWE crypto
|
Package composite provides the core crypto composite primitives such as ECDH-ES and ECDH-1PU to be used by JWE crypto |
primitive/composite/ecdh
Package ecdh provides implementations of payload encryption using ECDH-ES/1PU KW key wrapping with AEAD primitives.
|
Package ecdh provides implementations of payload encryption using ECDH-ES/1PU KW key wrapping with AEAD primitives. |
primitive/secp256k1/subtle
Package subtle provides subtle implementations of the digital signature primitive.
|
Package subtle provides subtle implementations of the digital signature primitive. |