Documentation
¶
Index ¶
Constants ¶
const KeyUsageAsSignature = "sig"
Variables ¶
This section is empty.
Functions ¶
func EncodeToString ¶
EncodeToString utility which converts []byte into a base64 string
func Jkws ¶
func Jkws(config Config) gin.HandlerFunc
Jkws middleware exposing the public key properties required in order to decrypt a jwt token
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the available options for the middleware.
type ConfigBuilder ¶
type ConfigBuilder struct {
// contains filtered or unexported fields
}
Config builder
func (*ConfigBuilder) Build ¶
func (b *ConfigBuilder) Build() (*Config, error)
Build the config object in order to initiate the middleware
func (*ConfigBuilder) ImportPrivateKey ¶
func (n *ConfigBuilder) ImportPrivateKey() *ConfigImportKeyBuilder
func (*ConfigBuilder) NewPrivateKey ¶
func (n *ConfigBuilder) NewPrivateKey() *ConfigNewKeyBuilder
type ConfigImportKeyBuilder ¶
type ConfigImportKeyBuilder struct {
ConfigBuilder
}
Import key face of the config builder
func (*ConfigImportKeyBuilder) WithKeyId ¶
func (n *ConfigImportKeyBuilder) WithKeyId(keyId string) *ConfigImportKeyBuilder
Add a key id to the private key
func (*ConfigImportKeyBuilder) WithPath ¶
func (n *ConfigImportKeyBuilder) WithPath(privateKeyPemPath string) *ConfigImportKeyBuilder
Add the private key path
type ConfigNewKeyBuilder ¶
type ConfigNewKeyBuilder struct {
ConfigBuilder
}
New key facet of the config builder
func (*ConfigNewKeyBuilder) WithKeyId ¶
func (n *ConfigNewKeyBuilder) WithKeyId(keyId string) *ConfigNewKeyBuilder
Add a key id to the private key
func (*ConfigNewKeyBuilder) WithKeyLength ¶
func (n *ConfigNewKeyBuilder) WithKeyLength(bits int) *ConfigNewKeyBuilder
Add the key length
type ImportKeyOptions ¶
type ImportKeyOptions struct {
// contains filtered or unexported fields
}
Structure used when the user imports an existing private key
func (*ImportKeyOptions) KeyId ¶
func (o *ImportKeyOptions) KeyId() string
type JkwsResponse ¶
type JkwsResponse struct { KeyTypeKey string `json:"kty"` AlgorithmKey string `json:"alg"` PubKeyExponentKey string `json:"e"` PubKeyModulusKey string `json:"n"` KeyUsageKey string `json:"use"` KeyIDKey string `json:"kid"` }
Refer to rfc for more information: https://www.rfc-editor.org/rfc/rfc7518#section-6.3.1
type NewKeyOptions ¶
type NewKeyOptions struct {
// contains filtered or unexported fields
}
Structure used when the user generates a new private key
func (*NewKeyOptions) KeyId ¶
func (o *NewKeyOptions) KeyId() string