Documentation ¶
Index ¶
- Constants
- func GenerateKey(kt shared.KeyType) (k shared.Key, err error)
- func GenerateKeyExchange(kxt shared.KeyXType) (kx shared.KeyExchange, err error)
- func NewFromRawKey(rawKey interface{}) (k shared.Key, err error)
- func NewKXFromBytes(kxBytes []byte) (kx shared.KeyExchange, err error)
- func NewKXFromStr(kxStr string) (kx shared.KeyExchange, err error)
- func NewKeyFromBytes(jwkBytes []byte) (k shared.Key, err error)
- func NewKeyFromStr(jwkStr string) (k shared.Key, err error)
Constants ¶
View Source
const ( // RSA2048 - generate an RSA 2048 bit key RSA2048 = shared.RSA2048 // RSA4096 - generate an RSA 4096 bit key RSA4096 = shared.RSA4096 // RSA4096 - generate an RSA 4096 bit key RSA8192 = shared.RSA8192 // ECDSA256 - generate an ECDSA 256 bit key ECDSA256 = shared.ECDSA256 // ECDSA384 - generate an ECDSA 384 bit key ECDSA384 = shared.ECDSA384 // ECDSA521 - generate an ECDSA 512 bit key ECDSA521 = shared.ECDSA521 // ED25519 - generates an ED25519 256 bit key ED25519 = shared.ED25519 )
View Source
const ( // CURVE25519 - generates a Curve25519 key exchange CURVE25519 = shared.CURVE25519 // ECDH256 - generates a EC Diffie-Hellman 256-bit key exchange ECDH256 = shared.ECDH256 // ECDH384 - generates a EC Diffie-Hellman 384-bit key exchange ECDH384 = shared.ECDH384 // ECDH521 - generates a EC Diffie-Hellman 521-bit key exchange ECDH521 = shared.ECDH521 )
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey - generates a new key
func GenerateKeyExchange ¶
func GenerateKeyExchange(kxt shared.KeyXType) (kx shared.KeyExchange, err error)
GenerateKeyExchange - generates a new key exchange public/private
func NewFromRawKey ¶ added in v2.0.4
NewFromRawKey - returns new instance of key from given raw key
func NewKXFromBytes ¶
func NewKXFromBytes(kxBytes []byte) (kx shared.KeyExchange, err error)
NewKXFromBytes - returns new instance of key exchange from given bytes
func NewKXFromStr ¶
func NewKXFromStr(kxStr string) (kx shared.KeyExchange, err error)
NewKXFromStr - returns new instance of key exchange from a given string
func NewKeyFromBytes ¶
NewKeyFromBytes - returns new instance of key from given JWK bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.