Documentation ¶
Index ¶
- func ParseSecretPrivateKey(data []byte) (pk *ecdsa.PrivateKey, err error)
- func SetMasterKey(hexKey string) (err error)
- func VerifyHashSig(key *ecdsa.PublicKey, data, sig []byte) bool
- type Key
- func (k *Key) Marshal() ([]byte, error)
- func (k *Key) NewPrivateKey() (err error)
- func (k *Key) ParseSecretPrivateKey(data []byte) (err error)
- func (k *Key) Sign(data []byte) (s []byte, err error)
- func (k *Key) TryMarshalSecretPrivateKey() []byte
- func (k *Key) TryParseSecretPrivateKey(data []byte)
- func (k *Key) Verify(data, sig []byte) (ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSecretPrivateKey ¶
func ParseSecretPrivateKey(data []byte) (pk *ecdsa.PrivateKey, err error)
ParseSecretPrivateKey parses ecdsa priv key from encrypted data. Data is encrypted with our master key. If it isn't or data is corrupted function returns error.
func SetMasterKey ¶
SetMasterKey set the master secret for this crypter. Need to be called before acator can be used. See AuthnCmd for more info.
Types ¶
type Key ¶
type Key struct { webauthncose.EC2PublicKeyData // contains filtered or unexported fields }
func NewFromPrivateKey ¶
func NewFromPrivateKey(priKey *ecdsa.PrivateKey) *Key
NewFromPrivateKey returns instance of our cose.Key where given priKey is in ecdsa fmt.
func (*Key) NewPrivateKey ¶
func (*Key) ParseSecretPrivateKey ¶
ParseSecretPrivateKey parses ecdsa priv key from encrypted data. Data is encrypted with our master key. If it isn't or data is corrupted function returns error. Called from acator!
func (*Key) TryMarshalSecretPrivateKey ¶
TryMarshalSecretPrivateKey marhalls our private key and encrypts it with the master key.
func (*Key) TryParseSecretPrivateKey ¶
TryParseSecretPrivateKey used from tests