Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AesJOSEEncryption ¶
type AesJOSEEncryption struct {
// contains filtered or unexported fields
}
AesJOSEEncryption implements JOSEEncryptionProvider for AES based key algorithm
type JOSEDecrypter ¶
JOSEDecrypter provides the necessary interface for a jose-decrypter implementation
type JOSEEncrypter ¶
JOSEEncrypter provides the necessary interface for a jose-encrypter implementation
type JOSEEncryptionProvider ¶
type JOSEEncryptionProvider interface {
JOSEEncrypter
JOSEDecrypter
}
JOSEEncryptionProvider provides the complete interface necessary to manage JOSE encryption/decryption
func NewAesJOSEEncryption ¶
func NewAesJOSEEncryption(keySource JOSEKeySource) (JOSEEncryptionProvider, error)
NewAesJOSEEncryption creates a new AES based JOSE encrypter
type JOSEKeyFileSource ¶
type JOSEKeyFileSource struct {
// KeysFilePath maintains the fil path that maintains the keys for encryption
// Keys-file needs to maintain keys in this format {"activeKeyId":<>, keys:[{"kty":<>,"kid":<>,"k":<>,"alg":<>}]]}
KeysFilePath string
// JwkSet maintains all the keys configuration from key-file
// and in a format that allows us to use jose's library functions effectively
JwkSet JWKSet
}
JOSEKeyFileSource loads keys from a file
func (*JOSEKeyFileSource) GetActiveKey ¶
func (js *JOSEKeyFileSource) GetActiveKey() jose.JSONWebKey
GetActiveKey loads the active key from the key source
func (*JOSEKeyFileSource) Init ¶
func (js *JOSEKeyFileSource) Init() error
Init initializes and validates the key configuration TODO: Explore and add support for automatically initing once during Load function using sync.
func (*JOSEKeyFileSource) Load ¶
func (js *JOSEKeyFileSource) Load(keyID string) (jose.JSONWebKey, error)
Load function loads a specific key-id details from that key source
type JOSEKeySource ¶
type JOSEKeySource interface {
// Init function should be called once to initialize based on the provided config
// This is a good place to add any implementation specific validation
Init() error
// GetActiveKey returns the active key used for encryption
GetActiveKey() jose.JSONWebKey
// Load return the key looked up by keyID. This is particularly useful during decryption
Load(keyID string) (jose.JSONWebKey, error)
}
JOSEKeySource is an interface that provides necessary interface to support fetching jose keys with the support for key rotation
type JWKSet ¶
type JWKSet struct {
ActiveKeyID string `json:"activeKeyId"`
jose.JSONWebKeySet
}
JWKSet maintains all the keys configuration from key-file and in a format that allows us to use jose's library functions effectively