Documentation ¶
Index ¶
- Variables
- type HostconfJwk
- func (hc *HostconfJwk) GetPrivateJWK(secrets secrets.AppSecrets) (privkey jwk.Key, state hostconf_jwk.KeyState, err error)
- func (hc *HostconfJwk) GetPrivateKeyState(secrets secrets.AppSecrets) (state hostconf_jwk.KeyState, err error)
- func (hc *HostconfJwk) GetPublicJWK() (pubkey jwk.Key, state hostconf_jwk.KeyState, err error)
- func (hc *HostconfJwk) GetPublicKeyState() (hostconf_jwk.KeyState, error)
- func (hc *HostconfJwk) Revoke() (err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HostconfJwk ¶
type HostconfJwk struct { gorm.Model KeyId string // JWK KID ExpiresAt time.Time // Expiration time stamp PublicJwk string // Public JWK as serialized JSON EncryptionId string // id of the encryption key EncryptedJwk []byte // Encrypted private key, nil if key is revoked }
HostconfJwks hold public and private JWKs
func NewHostconfJwk ¶
func NewHostconfJwk(secrets secrets.AppSecrets, expiresAt time.Time) (hc *HostconfJwk, err error)
Create a new Hostconf JWK entry with public and encrypted private JWK
func (*HostconfJwk) GetPrivateJWK ¶
func (hc *HostconfJwk) GetPrivateJWK(secrets secrets.AppSecrets) (privkey jwk.Key, state hostconf_jwk.KeyState, err error)
Decrypt and return private jwk.Key from entry Fails if key is invalid, expired, revoked, or not encrypted with secret.
func (*HostconfJwk) GetPrivateKeyState ¶
func (hc *HostconfJwk) GetPrivateKeyState(secrets secrets.AppSecrets) (state hostconf_jwk.KeyState, err error)
Get private key state (invalid, expired, revoked, mismatch, valid)
func (*HostconfJwk) GetPublicJWK ¶
func (hc *HostconfJwk) GetPublicJWK() (pubkey jwk.Key, state hostconf_jwk.KeyState, err error)
Get public jwk.Key from entry Fails if key is invalid, expired, or revoked.
func (*HostconfJwk) GetPublicKeyState ¶
func (hc *HostconfJwk) GetPublicKeyState() (hostconf_jwk.KeyState, error)
Get public key state (invalid, expired, revoked, valid) A public key can be valid although its private key cannot be decrypted by current secret.
func (*HostconfJwk) Revoke ¶
func (hc *HostconfJwk) Revoke() (err error)
Revoke sets the encrypted private key to nil and marks the hostconf JWK as revoked.
Click to show internal directories.
Click to hide internal directories.