jwksupport

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JWKFromKey

func JWKFromKey(opaqueKey interface{}) (*jwk.JWK, error)

JWKFromKey creates a JWK from an opaque key struct. It's e.g. *ecdsa.PublicKey, *ecdsa.PrivateKey, ed25519.VerificationMethod, *bbs12381g2pub.PrivateKey or *bbs12381g2pub.PublicKey.

func JWKFromX25519Key

func JWKFromX25519Key(pubKey []byte) (*jwk.JWK, error)

JWKFromX25519Key is similar to JWKFromKey but is specific to X25519 keys when using a public key as raw []byte. This builder function presets the curve and key type in the JWK. Using JWKFromKey for X25519 raw keys will not have these fields set and will not provide the right JWK output.

func PubKeyBytesToJWK

func PubKeyBytesToJWK(bytes []byte, keyType kms.KeyType) (*jwk.JWK, error)

PubKeyBytesToJWK converts marshalled bytes of keyType into JWK.

func PublicKeyFromJWK

func PublicKeyFromJWK(jwkKey *jwk.JWK) (*crypto.PublicKey, error)

PublicKeyFromJWK builds a crypto.PublicKey from jwkKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL