jwk

package
v0.1.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const EncryptionProviderJwk = "baton/jwk/v1"

TODO(morgabra): Fix the circular dependency/entire registry pattern here.

Variables

View Source
var JWKInvalidKeyTypeError = fmt.Errorf("jwk: invalid key type")
View Source
var JWKUnsupportedKeyTypeError = fmt.Errorf("jwk: unsupported key type")

Functions

func DecryptECDSA

func DecryptECDSA(privKey *ecdsa.PrivateKey, ciphertext []byte) ([]byte, error)

func DecryptED25519

func DecryptED25519(privKey ed25519.PrivateKey, ciphertext []byte) ([]byte, error)

func DecryptRSA

func DecryptRSA(privKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)

func EncryptECDSA

func EncryptECDSA(pubKey *ecdsa.PublicKey, plaintext []byte) ([]byte, error)

func EncryptED25519

func EncryptED25519(pubKey ed25519.PublicKey, plaintext []byte) ([]byte, error)

func EncryptRSA

func EncryptRSA(pubKey *rsa.PublicKey, plaintext []byte) ([]byte, error)

Types

type JWKEncryptionProvider

type JWKEncryptionProvider struct{}

func (*JWKEncryptionProvider) Decrypt

func (j *JWKEncryptionProvider) Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey []byte) (*v2.PlaintextData, error)

func (*JWKEncryptionProvider) Encrypt

func (*JWKEncryptionProvider) GenerateKey

func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL