Documentation ¶
Index ¶
- Constants
- Variables
- func DecryptECDSA(privKey *ecdsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func DecryptED25519(privKey ed25519.PrivateKey, ciphertext []byte) ([]byte, error)
- func DecryptRSA(privKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func EncryptECDSA(pubKey *ecdsa.PublicKey, plaintext []byte) ([]byte, error)
- func EncryptED25519(pubKey ed25519.PublicKey, plaintext []byte) ([]byte, error)
- func EncryptRSA(pubKey *rsa.PublicKey, plaintext []byte) ([]byte, error)
- type JWKEncryptionProvider
- func (j *JWKEncryptionProvider) Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey []byte) (*v2.PlaintextData, error)
- func (j *JWKEncryptionProvider) Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error)
- func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, error)
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 EncryptED25519 ¶
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 (j *JWKEncryptionProvider) Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error)
func (*JWKEncryptionProvider) GenerateKey ¶
func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, error)
Click to show internal directories.
Click to hide internal directories.