Documentation
¶
Overview ¶
Package crypto is a generated GoMock package.
Index ¶
- Constants
- Variables
- func EciesDecrypt(privateKey *ecdsa.PrivateKey, cipherText []byte) ([]byte, error)
- func EciesEncrypt(publicKey *ecdsa.PublicKey, plainText []byte) ([]byte, error)
- func EncryptJWE(payload []byte, protectedHeaders map[string]interface{}, publicKey interface{}) (message string, err error)
- func ExtractProtectedHeaders(jwt string) (map[string]interface{}, error)
- func GenerateJWK() (jwk.Key, error)
- func GenerateNonce() string
- func JWTKidAlg(tokenString string) (string, jwa.SignatureAlgorithm, error)
- func NewMemoryStorage() spi.Storage
- func ParseJWS(token []byte, f PublicKeyFunc) (payload []byte, err error)
- func ParseJWT(tokenString string, f PublicKeyFunc, options ...jwt.ParseOption) (jwt.Token, error)
- func SignJWS(ctx context.Context, payload []byte, protectedHeaders map[string]interface{}, ...) (string, error)
- func SignJWT(ctx context.Context, key crypto.Signer, alg jwa.SignatureAlgorithm, ...) (token string, err error)
- func SignatureAlgorithm(key crypto.PublicKey) (jwa.SignatureAlgorithm, error)
- func Thumbprint(key jwk.Key) (string, error)
- type Config
- type Crypto
- func (client *Crypto) CheckHealth() map[string]core.Health
- func (client *Crypto) Config() interface{}
- func (client *Crypto) Configure(config core.ServerConfig) error
- func (client *Crypto) Decrypt(ctx context.Context, kid string, cipherText []byte) ([]byte, error)
- func (client *Crypto) DecryptJWE(ctx context.Context, message string) (body []byte, headers map[string]interface{}, err error)
- func (client *Crypto) Delete(ctx context.Context, kid string) error
- func (client *Crypto) EncryptJWE(ctx context.Context, payload []byte, headers map[string]interface{}, ...) (string, error)
- func (client *Crypto) Exists(ctx context.Context, kid string) (bool, error)
- func (client *Crypto) Link(ctx context.Context, kid string, keyName string, version string) error
- func (client *Crypto) List(ctx context.Context) []string
- func (client *Crypto) Migrate() error
- func (client *Crypto) Name() string
- func (client *Crypto) New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
- func (client *Crypto) Resolve(ctx context.Context, kid string) (crypto.PublicKey, error)
- func (client *Crypto) SignDPoP(ctx context.Context, token dpop.DPoP, kid string) (string, error)
- func (client *Crypto) SignJWS(ctx context.Context, payload []byte, headers map[string]interface{}, ...) (string, error)
- func (client *Crypto) SignJWT(ctx context.Context, claims map[string]interface{}, ...) (string, error)
- type Decrypter
- type JWTSigner
- type JsonWebEncryptor
- type KIDNamingFunc
- type KeyCreator
- type KeyResolver
- type KeyStore
- type MemoryJWTSigner
- func (m MemoryJWTSigner) SignDPoP(_ context.Context, _ dpop.DPoP, _ string) (string, error)
- func (m MemoryJWTSigner) SignJWS(ctx context.Context, payload []byte, headers map[string]interface{}, ...) (string, error)
- func (m MemoryJWTSigner) SignJWT(ctx context.Context, claims map[string]interface{}, ...) (string, error)
- type MockDecrypter
- type MockDecrypterMockRecorder
- type MockJWTSigner
- func (m *MockJWTSigner) EXPECT() *MockJWTSignerMockRecorder
- func (m *MockJWTSigner) SignDPoP(ctx context.Context, token dpop.DPoP, kid string) (string, error)
- func (m *MockJWTSigner) SignJWS(ctx context.Context, payload []byte, headers map[string]any, kid string, ...) (string, error)
- func (m *MockJWTSigner) SignJWT(ctx context.Context, claims, headers map[string]any, kid string) (string, error)
- type MockJWTSignerMockRecorder
- type MockJsonWebEncryptor
- func (m *MockJsonWebEncryptor) DecryptJWE(ctx context.Context, message string) ([]byte, map[string]any, error)
- func (m *MockJsonWebEncryptor) EXPECT() *MockJsonWebEncryptorMockRecorder
- func (m *MockJsonWebEncryptor) EncryptJWE(ctx context.Context, payload []byte, headers map[string]any, publicKey any) (string, error)
- type MockJsonWebEncryptorMockRecorder
- type MockKeyCreator
- type MockKeyCreatorMockRecorder
- type MockKeyResolver
- type MockKeyResolverMockRecorder
- type MockKeyStore
- func (m *MockKeyStore) Decrypt(ctx context.Context, kid string, ciphertext []byte) ([]byte, error)
- func (m *MockKeyStore) DecryptJWE(ctx context.Context, message string) ([]byte, map[string]any, error)
- func (m *MockKeyStore) Delete(ctx context.Context, kid string) error
- func (m *MockKeyStore) EXPECT() *MockKeyStoreMockRecorder
- func (m *MockKeyStore) EncryptJWE(ctx context.Context, payload []byte, headers map[string]any, publicKey any) (string, error)
- func (m *MockKeyStore) Exists(ctx context.Context, kid string) (bool, error)
- func (m *MockKeyStore) Link(ctx context.Context, kid, keyName, version string) error
- func (m *MockKeyStore) List(ctx context.Context) []string
- func (m *MockKeyStore) New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
- func (m *MockKeyStore) Resolve(ctx context.Context, kid string) (crypto.PublicKey, error)
- func (m *MockKeyStore) SignDPoP(ctx context.Context, token dpop.DPoP, kid string) (string, error)
- func (m *MockKeyStore) SignJWS(ctx context.Context, payload []byte, headers map[string]any, kid string, ...) (string, error)
- func (m *MockKeyStore) SignJWT(ctx context.Context, claims, headers map[string]any, kid string) (string, error)
- type MockKeyStoreMockRecorder
- func (mr *MockKeyStoreMockRecorder) Decrypt(ctx, kid, ciphertext any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) DecryptJWE(ctx, message any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) Delete(ctx, kid any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) EncryptJWE(ctx, payload, headers, publicKey any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) Exists(ctx, kid any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) Link(ctx, kid, keyName, version any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) List(ctx any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) New(ctx, namingFunc, requiredUsage any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) Resolve(ctx, kid any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) SignDPoP(ctx, token, kid any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) SignJWS(ctx, payload, headers, kid, detached any) *gomock.Call
- func (mr *MockKeyStoreMockRecorder) SignJWT(ctx, claims, headers, kid any) *gomock.Call
- type PublicKeyFunc
- type TestKey
Constants ¶
const (
// ModuleName contains the name of this module
ModuleName = "Crypto"
)
Variables ¶
var ErrKeyUsageNotSupported = errors.New("the key store can't create a key that supports the requested key usage")
ErrKeyUsageNotSupported is returned when the configured key store backend can't create a key that backs the requested DIDKeyFlags, e.g. Azure Key Vault can't create keys usable for decryption/KeyAgreement. No key is created when this is returned.
var ErrPrivateKeyNotFound = errors.New("private key not found")
ErrPrivateKeyNotFound is returned when the private key doesn't exist
var ErrorInvalidNumberOfSignatures = errors.New("invalid number of signatures")
ErrorInvalidNumberOfSignatures indicates that the number of signatures present in the JWT is invalid.
Functions ¶
func EciesDecrypt ¶
func EciesDecrypt(privateKey *ecdsa.PrivateKey, cipherText []byte) ([]byte, error)
EciesDecrypt decrypts the `cipherText` using the Elliptic Curve Integrated Encryption Scheme
func EciesEncrypt ¶
EciesEncrypt encrypts the `plainText` using the Elliptic Curve Integrated Encryption Scheme
func EncryptJWE ¶
func ExtractProtectedHeaders ¶
ExtractProtectedHeaders extracts the protected headers from a JWT string. The function takes a JWT string as input and returns a map of the protected headers. Note that:
- This method ignores any parsing errors and returns an empty map instead of an error.
func GenerateJWK ¶
GenerateJWK a new in-memory key pair and returns it as JWK. It sets the alg field of the JWK.
func JWTKidAlg ¶
func JWTKidAlg(tokenString string) (string, jwa.SignatureAlgorithm, error)
JWTKidAlg parses a JWT, does not validate it and returns the 'kid' and 'alg' headers
func NewMemoryStorage ¶
func ParseJWS ¶
func ParseJWS(token []byte, f PublicKeyFunc) (payload []byte, err error)
ParseJWS parses a JWS byte array object, validates and verifies it. This method returns the value of the payload as byte array, or an error if the parsing fails at any level.
func ParseJWT ¶
func ParseJWT(tokenString string, f PublicKeyFunc, options ...jwt.ParseOption) (jwt.Token, error)
ParseJWT parses a token, validates and verifies it.
func SignJWT ¶
func SignJWT(ctx context.Context, key crypto.Signer, alg jwa.SignatureAlgorithm, claims map[string]interface{}, headers map[string]interface{}) (token string, err error)
SignJWT signs claims with the signer and returns the compacted token. The headers param can be used to add additional headers
func SignatureAlgorithm ¶
func SignatureAlgorithm(key crypto.PublicKey) (jwa.SignatureAlgorithm, error)
SignatureAlgorithm determines the jwa.SigningAlgorithm for ec/rsa/ed25519 keys.
Types ¶
type Config ¶
type Config struct {
Storage string `koanf:"storage"`
Vault vault.Config `koanf:"vault"`
AzureKeyVault azure.Config `koanf:"azurekv"`
External external.Config `koanf:"external"`
}
Config holds the values for the crypto engine
func DefaultCryptoConfig ¶
func DefaultCryptoConfig() Config
DefaultCryptoConfig returns a Config with default settings for Vault and Azure keyVault
type Crypto ¶
type Crypto struct {
// contains filtered or unexported fields
}
Crypto holds references to storage and needed config
func NewAzureKeyVaultLikeCryptoInstance ¶
NewAzureKeyVaultLikeCryptoInstance returns a Crypto test instance configured as if it were using the Azure Key Vault backend, without needing a real Azure connection: it can back signing, but not KeyAgreement (decryption/ECDH).
func NewCryptoInstance ¶
NewCryptoInstance creates a new instance of the crypto engine.
func NewDatabaseCryptoInstance ¶
NewDatabaseCryptoInstance returns a new Crypto instance to be used for tests, storing keys in-memory and the given DB.
func NewMemoryCryptoInstance ¶
NewMemoryCryptoInstance returns a new Crypto instance to be used for tests, storing keys in-memory and creating a new SQL DB.
func NewTestCryptoInstance ¶
NewTestCryptoInstance returns a new Crypto instance to be used for tests, allowing to use of preconfigured backend.
func (*Crypto) Configure ¶
func (client *Crypto) Configure(config core.ServerConfig) error
Configure loads the given configurations in the engine. Any wrong combination will return an error
func (*Crypto) DecryptJWE ¶
func (client *Crypto) DecryptJWE(ctx context.Context, message string) (body []byte, headers map[string]interface{}, err error)
DecryptJWE decrypts a message using the associated private key from the kid header.
func (*Crypto) EncryptJWE ¶
func (client *Crypto) EncryptJWE(ctx context.Context, payload []byte, headers map[string]interface{}, publicKey interface{}) (string, error)
EncryptJWE encrypts a payload using the provided public key and key identifier.
func (*Crypto) Exists ¶
Exists checks storage for an entry for the given legal entity and returns true if it exists
func (*Crypto) New ¶
func (client *Crypto) New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
New generates a new key pair. Stores the private key, returns the public key and DB reference. requiredUsage is checked against supportedKeyUsage before any key is created: if the configured backend can't fully back it (e.g. Azure Key Vault can't back KeyAgreement, since it doesn't support decryption/ECDH), no key is created and ErrKeyUsageNotSupported is returned. It also returns an error when a key with the resulting ID already exists.
type Decrypter ¶
type Decrypter interface {
// Decrypt decrypts the `cipherText` with key `kid`
// The context is used to pass audit information.
// Note: decryption isn't audit logged, because:
// - it involved very deep context passing,
// - it's called by the system itself, not triggered by a user.
// - to be removed in near future when we switch to multi-chains, which eliminates private TXs and thus encryption altogether.
Decrypt(ctx context.Context, kid string, ciphertext []byte) ([]byte, error)
}
Decrypter is the interface to support decryption
type JWTSigner ¶
type JWTSigner interface {
// SignJWT creates a signed JWT using the indicated key and map of claims and additional headers.
// The KID is the external facing Key ID (eg: from the DID Document). the context is used to pass audit information.
// The headers can be used to add/override headers in the JWT.
// Returns ErrPrivateKeyNotFound when the private key is not present.
SignJWT(ctx context.Context, claims map[string]interface{}, headers map[string]interface{}, kid string) (string, error)
// SignJWS creates a signed JWS using the indicated key and map of headers and payload as bytes.
// The detached boolean indicates if the body needs to be excluded from the response (detached mode).
// The KID is the external facing Key ID (eg: from the DID Document).
// context is used to pass audit information.
// Returns ErrPrivateKeyNotFound when the private key is not present.
SignJWS(ctx context.Context, payload []byte, headers map[string]interface{}, kid string, detached bool) (string, error)
// SignDPoP signs a DPoP token for the given kid.
// It adds the requested key as jwk header to the DPoP token.
SignDPoP(ctx context.Context, token dpop.DPoP, kid string) (string, error)
}
JWTSigner is the interface used to sign authorization tokens.
type JsonWebEncryptor ¶
type JsonWebEncryptor interface {
// EncryptJWE encrypts a payload as bytes into a JWE message with the given key and kid.
// The publicKey must be a public key
// The kid must be the KeyID and will be placed in the header, if not set.
EncryptJWE(ctx context.Context, payload []byte, headers map[string]interface{}, publicKey interface{}) (string, error)
// DecryptJWE decrypts a message as bytes into a decrypted body and headers.
// The corresponding private key must be located in the KeyID (kid) header.
DecryptJWE(ctx context.Context, message string) (body []byte, headers map[string]interface{}, err error)
}
JsonWebEncryptor is the interface used to encrypt and decrypt JWE messages.
type KIDNamingFunc ¶
KIDNamingFunc is a function passed to New() which generates the kid for the pub/priv key
func ErrorNamingFunc ¶
func ErrorNamingFunc(err error) KIDNamingFunc
func StringNamingFunc ¶
func StringNamingFunc(name string) KIDNamingFunc
type KeyCreator ¶
type KeyCreator interface {
// New generates a keypair and returns a reference. The context is used to pass audit information.
// It generates a key at the backend and stores its reference in the SQL DB.
// A DB transaction may be passed through the context using `orm.TransactionKey`.
// requiredUsage is checked against what the configured key store backend can actually back (e.g.
// an Azure Key Vault EC key can't be used for KeyAgreement, since Azure Key Vault doesn't support
// decryption/ECDH with it) before any key is created. If the backend can't fully satisfy it, no
// key is created and ErrKeyUsageNotSupported is returned.
New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
}
KeyCreator is the interface for creating key pairs.
type KeyResolver ¶
type KeyResolver interface {
// Exists returns if the specified private key exists.
// If an error occurs, false is also returned
Exists(ctx context.Context, kid string) (bool, error)
// Resolve returns a Key for the given KID. ErrPrivateKeyNotFound is returned for an unknown KID.
Resolve(ctx context.Context, kid string) (crypto.PublicKey, error)
// List returns the KIDs of the private keys that are present in the KeyStore.
List(ctx context.Context) []string
}
KeyResolver is the interface for resolving keys.
type KeyStore ¶
type KeyStore interface {
Decrypter
JsonWebEncryptor
KeyCreator
KeyResolver
JWTSigner
// Delete removes the private key with the given KID from the KeyStore.
Delete(ctx context.Context, kid string) error
// Link links the key in the keystore to a kid
// see https://github.com/nuts-foundation/nuts-node/issues/3292
Link(ctx context.Context, kid string, keyName string, version string) error
}
KeyStore defines the functions for working with private keys.
type MemoryJWTSigner ¶
MemoryJWTSigner is a JWTSigner implementation that performs cryptographic operations on an in-memory JWK. This should only be used for low-assurance use cases, e.g. session-bound user keys.
type MockDecrypter ¶
type MockDecrypter struct {
// contains filtered or unexported fields
}
MockDecrypter is a mock of Decrypter interface.
func NewMockDecrypter ¶
func NewMockDecrypter(ctrl *gomock.Controller) *MockDecrypter
NewMockDecrypter creates a new mock instance.
func (*MockDecrypter) EXPECT ¶
func (m *MockDecrypter) EXPECT() *MockDecrypterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDecrypterMockRecorder ¶
type MockDecrypterMockRecorder struct {
// contains filtered or unexported fields
}
MockDecrypterMockRecorder is the mock recorder for MockDecrypter.
type MockJWTSigner ¶
type MockJWTSigner struct {
// contains filtered or unexported fields
}
MockJWTSigner is a mock of JWTSigner interface.
func NewMockJWTSigner ¶
func NewMockJWTSigner(ctrl *gomock.Controller) *MockJWTSigner
NewMockJWTSigner creates a new mock instance.
func (*MockJWTSigner) EXPECT ¶
func (m *MockJWTSigner) EXPECT() *MockJWTSignerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockJWTSignerMockRecorder ¶
type MockJWTSignerMockRecorder struct {
// contains filtered or unexported fields
}
MockJWTSignerMockRecorder is the mock recorder for MockJWTSigner.
func (*MockJWTSignerMockRecorder) SignDPoP ¶
func (mr *MockJWTSignerMockRecorder) SignDPoP(ctx, token, kid any) *gomock.Call
SignDPoP indicates an expected call of SignDPoP.
type MockJsonWebEncryptor ¶
type MockJsonWebEncryptor struct {
// contains filtered or unexported fields
}
MockJsonWebEncryptor is a mock of JsonWebEncryptor interface.
func NewMockJsonWebEncryptor ¶
func NewMockJsonWebEncryptor(ctrl *gomock.Controller) *MockJsonWebEncryptor
NewMockJsonWebEncryptor creates a new mock instance.
func (*MockJsonWebEncryptor) DecryptJWE ¶
func (m *MockJsonWebEncryptor) DecryptJWE(ctx context.Context, message string) ([]byte, map[string]any, error)
DecryptJWE mocks base method.
func (*MockJsonWebEncryptor) EXPECT ¶
func (m *MockJsonWebEncryptor) EXPECT() *MockJsonWebEncryptorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockJsonWebEncryptorMockRecorder ¶
type MockJsonWebEncryptorMockRecorder struct {
// contains filtered or unexported fields
}
MockJsonWebEncryptorMockRecorder is the mock recorder for MockJsonWebEncryptor.
func (*MockJsonWebEncryptorMockRecorder) DecryptJWE ¶
func (mr *MockJsonWebEncryptorMockRecorder) DecryptJWE(ctx, message any) *gomock.Call
DecryptJWE indicates an expected call of DecryptJWE.
func (*MockJsonWebEncryptorMockRecorder) EncryptJWE ¶
func (mr *MockJsonWebEncryptorMockRecorder) EncryptJWE(ctx, payload, headers, publicKey any) *gomock.Call
EncryptJWE indicates an expected call of EncryptJWE.
type MockKeyCreator ¶
type MockKeyCreator struct {
// contains filtered or unexported fields
}
MockKeyCreator is a mock of KeyCreator interface.
func NewMockKeyCreator ¶
func NewMockKeyCreator(ctrl *gomock.Controller) *MockKeyCreator
NewMockKeyCreator creates a new mock instance.
func (*MockKeyCreator) EXPECT ¶
func (m *MockKeyCreator) EXPECT() *MockKeyCreatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKeyCreator) New ¶
func (m *MockKeyCreator) New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
New mocks base method.
type MockKeyCreatorMockRecorder ¶
type MockKeyCreatorMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyCreatorMockRecorder is the mock recorder for MockKeyCreator.
type MockKeyResolver ¶
type MockKeyResolver struct {
// contains filtered or unexported fields
}
MockKeyResolver is a mock of KeyResolver interface.
func NewMockKeyResolver ¶
func NewMockKeyResolver(ctrl *gomock.Controller) *MockKeyResolver
NewMockKeyResolver creates a new mock instance.
func (*MockKeyResolver) EXPECT ¶
func (m *MockKeyResolver) EXPECT() *MockKeyResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockKeyResolverMockRecorder ¶
type MockKeyResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyResolverMockRecorder is the mock recorder for MockKeyResolver.
func (*MockKeyResolverMockRecorder) Exists ¶
func (mr *MockKeyResolverMockRecorder) Exists(ctx, kid any) *gomock.Call
Exists indicates an expected call of Exists.
type MockKeyStore ¶
type MockKeyStore struct {
// contains filtered or unexported fields
}
MockKeyStore is a mock of KeyStore interface.
func NewMockKeyStore ¶
func NewMockKeyStore(ctrl *gomock.Controller) *MockKeyStore
NewMockKeyStore creates a new mock instance.
func (*MockKeyStore) DecryptJWE ¶
func (m *MockKeyStore) DecryptJWE(ctx context.Context, message string) ([]byte, map[string]any, error)
DecryptJWE mocks base method.
func (*MockKeyStore) Delete ¶
func (m *MockKeyStore) Delete(ctx context.Context, kid string) error
Delete mocks base method.
func (*MockKeyStore) EXPECT ¶
func (m *MockKeyStore) EXPECT() *MockKeyStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKeyStore) EncryptJWE ¶
func (m *MockKeyStore) EncryptJWE(ctx context.Context, payload []byte, headers map[string]any, publicKey any) (string, error)
EncryptJWE mocks base method.
func (*MockKeyStore) Link ¶
func (m *MockKeyStore) Link(ctx context.Context, kid, keyName, version string) error
Link mocks base method.
func (*MockKeyStore) List ¶
func (m *MockKeyStore) List(ctx context.Context) []string
List mocks base method.
func (*MockKeyStore) New ¶
func (m *MockKeyStore) New(ctx context.Context, namingFunc KIDNamingFunc, requiredUsage orm.DIDKeyFlags) (*orm.KeyReference, crypto.PublicKey, error)
New mocks base method.
type MockKeyStoreMockRecorder ¶
type MockKeyStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyStoreMockRecorder is the mock recorder for MockKeyStore.
func (*MockKeyStoreMockRecorder) Decrypt ¶
func (mr *MockKeyStoreMockRecorder) Decrypt(ctx, kid, ciphertext any) *gomock.Call
Decrypt indicates an expected call of Decrypt.
func (*MockKeyStoreMockRecorder) DecryptJWE ¶
func (mr *MockKeyStoreMockRecorder) DecryptJWE(ctx, message any) *gomock.Call
DecryptJWE indicates an expected call of DecryptJWE.
func (*MockKeyStoreMockRecorder) Delete ¶
func (mr *MockKeyStoreMockRecorder) Delete(ctx, kid any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockKeyStoreMockRecorder) EncryptJWE ¶
func (mr *MockKeyStoreMockRecorder) EncryptJWE(ctx, payload, headers, publicKey any) *gomock.Call
EncryptJWE indicates an expected call of EncryptJWE.
func (*MockKeyStoreMockRecorder) Exists ¶
func (mr *MockKeyStoreMockRecorder) Exists(ctx, kid any) *gomock.Call
Exists indicates an expected call of Exists.
func (*MockKeyStoreMockRecorder) Link ¶
func (mr *MockKeyStoreMockRecorder) Link(ctx, kid, keyName, version any) *gomock.Call
Link indicates an expected call of Link.
func (*MockKeyStoreMockRecorder) List ¶
func (mr *MockKeyStoreMockRecorder) List(ctx any) *gomock.Call
List indicates an expected call of List.
func (*MockKeyStoreMockRecorder) New ¶
func (mr *MockKeyStoreMockRecorder) New(ctx, namingFunc, requiredUsage any) *gomock.Call
New indicates an expected call of New.
func (*MockKeyStoreMockRecorder) Resolve ¶
func (mr *MockKeyStoreMockRecorder) Resolve(ctx, kid any) *gomock.Call
Resolve indicates an expected call of Resolve.
func (*MockKeyStoreMockRecorder) SignDPoP ¶
func (mr *MockKeyStoreMockRecorder) SignDPoP(ctx, token, kid any) *gomock.Call
SignDPoP indicates an expected call of SignDPoP.
type PublicKeyFunc ¶
PublicKeyFunc defines a function that resolves a public key based on a kid
type TestKey ¶
TestKey is a Key impl for testing purposes
func NewTestKey ¶
NewTestKey creates a new TestKey with a given kid
func (TestKey) Private ¶
func (t TestKey) Private() crypto.PrivateKey
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
v1
Package v1 provides primitives to interact with the openapi HTTP API.
|
Package v1 provides primitives to interact with the openapi HTTP API. |
|
Package storage provides secret storage for the Crypto module.
|
Package storage provides secret storage for the Crypto module. |
|
azure
Package azure is a generated GoMock package.
|
Package azure is a generated GoMock package. |
|
external
Package external provides primitives to interact with the openapi HTTP API.
|
Package external provides primitives to interact with the openapi HTTP API. |
|
spi
Package spi is a generated GoMock package.
|
Package spi is a generated GoMock package. |