Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Unknown - unknown key type Unknown = shared.Unknown // ED25519 - generates an ED25519 256 bit key ED25519 = shared.ED25519 // 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 // 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 )
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 GetKeyType ¶ added in v2.0.6
GetKeyType - returns proper key type given its name
func GetKeyXType ¶ added in v2.0.6
GetKeyXType - returns proper key exchange type given its name
Types ¶
type Key ¶ added in v2.0.5
type Key = shared.Key // create an alias so users don't need to understand the layout of the library to use this type
Key - alias of `shared.Key`
func NewFromRawKey ¶ added in v2.0.4
NewFromRawKey - returns new instance of key from given raw key
func NewKeyFromBytes ¶
NewKeyFromBytes - returns new instance of key from given JWK bytes
func NewKeyFromStr ¶
NewKeyFromStr - returns new instance of key from a given JWK string
type KeyExchange ¶ added in v2.0.5
type KeyExchange = shared.KeyExchange
Key - alias of `shared.KeyExchange`
func NewKXFromBytes ¶
func NewKXFromBytes(kxBytes []byte) (kx KeyExchange, err error)
NewKXFromBytes - returns new instance of key exchange from given bytes
func NewKXFromStr ¶
func NewKXFromStr(kxStr string) (kx KeyExchange, err error)
NewKXFromStr - returns new instance of key exchange from a given string
Click to show internal directories.
Click to hide internal directories.