Documentation ¶
Index ¶
- Variables
- func GenKey() (*ecdsa.PrivateKey, *jose.JSONWebKey)
- func GeneratePassword(credentialOptions *v2.CredentialOptions) (string, error)
- func GenerateRandomPassword(randomPassword *v2.CredentialOptions_RandomPassword) (string, error)
- func NewEncryptor(pubKey *jose.JSONWebKey) (jose.Encrypter, error)
- func ParsePublicKey(input []byte) (*jose.JSONWebKey, error)
- type EncryptionManager
- type PlaintextCredential
- type PubKeyEncryptionManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidCredentialOptions = errors.New("unknown credential options")
View Source
var ErrInvalidPasswordLength = errors.New("invalid password length")
View Source
var ErrInvalidPublicKey = errors.New("invalid public key")
Functions ¶
func GenKey ¶
func GenKey() (*ecdsa.PrivateKey, *jose.JSONWebKey)
GenKey generates a new ecdsa keypair and returns the private key and public key JWK It panics on any error.
func GeneratePassword ¶
func GeneratePassword(credentialOptions *v2.CredentialOptions) (string, error)
func GenerateRandomPassword ¶
func GenerateRandomPassword(randomPassword *v2.CredentialOptions_RandomPassword) (string, error)
func NewEncryptor ¶
func NewEncryptor(pubKey *jose.JSONWebKey) (jose.Encrypter, error)
func ParsePublicKey ¶
ParsePublicKey parses a public ecdsa JWK, all other key types return errors.
Types ¶
type EncryptionManager ¶
type EncryptionManager interface {
Encrypt(cred *PlaintextCredential) ([]*v2.EncryptedData, error)
}
type PlaintextCredential ¶
type PubKeyEncryptionManager ¶
type PubKeyEncryptionManager struct {
// contains filtered or unexported fields
}
func NewPubKeyEncryptionManager ¶
func NewPubKeyEncryptionManager(co *v2.CredentialOptions, ec []*v2.EncryptionConfig) (*PubKeyEncryptionManager, error)
func (*PubKeyEncryptionManager) Encrypt ¶
func (pkem *PubKeyEncryptionManager) Encrypt(cred *PlaintextCredential) ([]*v2.EncryptedData, error)
Click to show internal directories.
Click to hide internal directories.