Documentation ¶
Index ¶
- func GetKXPubKey(privateKey [32]byte) (publicKey [32]byte)
- func NewKX() (privateKey [32]byte, err error)
- func SharedSecret(ownPrivateKey, targetPubKey [32]byte) (sharedSecret []byte, err error)
- type JWK
- func (j *JWK) Bytes() (bytes []byte)
- func (j *JWK) Key() (key interface{})
- func (j *JWK) PEM() (pemBytes []byte)
- func (j *JWK) PublicKey() (p *JWK)
- func (j *JWK) SetKeyID(kid string)
- func (j *JWK) Sign(hashed []byte) (signed []byte, err error)
- func (j *JWK) String() (str string)
- func (j *JWK) Verify(signed, hashed []byte) (err error)
- type KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKXPubKey ¶ added in v1.3.0
func SharedSecret ¶ added in v1.2.0
Types ¶
type JWK ¶
type JWK struct { Kty string `yaml:"kty,omitempty" json:"kty,omitempty"` Crv string `yaml:"crv,omitempty" json:"crv,omitempty"` N string `yaml:"n,omitempty" json:"n,omitempty"` E string `yaml:"e,omitempty" json:"e,omitempty"` G string `yaml:"g,omitempty" json:"g,omitempty"` P string `yaml:"p,omitempty" json:"p,omitempty"` Q string `yaml:"q,omitempty" json:"q,omitempty"` X string `yaml:"x,omitempty" json:"x,omitempty"` Y string `yaml:"y,omitempty" json:"y,omitempty"` D string `yaml:"d,omitempty" json:"d,omitempty"` DP string `yaml:"dp,omitempty" json:"dp,omitempty"` DQ string `yaml:"dq,omitempty" json:"dq,omitempty"` QI string `yaml:"qi,omitempty" json:"qi,omitempty"` Kid string `yaml:"kid,omitempty" json:"kid,omitempty"` // contains filtered or unexported fields }
JWK - RSA & EC keys is in JWK format
func (*JWK) Key ¶
func (j *JWK) Key() (key interface{})
Key - returns an `RSA` or `ECDSA` instance of the Key, this will return private key first and if it doesn't exist, only then return the public key
type KeyType ¶
type KeyType uint8 // new type to define key types to be generated
const ( // RSA2048 - generate an RSA 2048 bit key RSA2048 KeyType = iota // RSA4096 - generate an RSA 4096 bit key RSA4096 // ECDSA256 - generate an ECDSA 256 bit key ECDSA256 // ECDSA384 - generate an ECDSA 384 bit key ECDSA384 // ECDSA521 - generate an ECDSA 512 bit key ECDSA521 // ED25519 - generates an ED25519 256 bit key ED25519 )
Click to show internal directories.
Click to hide internal directories.