pem2jwks

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePEM

func ParsePEM(bytes []byte) ([][]byte, error)

ParsePEM extracts the set of byte blocks from a PEM "ascii-armoured" file. These are expected to be DER encodings of cryptographic objects

func ParsePrivateKey

func ParsePrivateKey(der []byte) (crypto.PrivateKey, error)

func ParsePublicKey

func ParsePublicKey(der []byte) (crypto.PublicKey, error)

ParsePublicKey extracts the public key from the given cryptographic object. That object is expected to be the DER encoding of: * an x509 encoding (ie ASN.1 serialization) of a public key * a PKCS#1 (ie ASN.1 encoding) containing a public key * an x509 encoding (ie ASN.1 serialization) of a certificate * a PKCS#1 (ie ASN.1 encoding) containing a private key * a PKCS#8 (ie ASN.1 encoding) containing a private key * a SEC 1 (ie ASN.1 encoding) containing an EC private key

Types

type Jwk

type Jwk json.Marshaler

func PrivateKey2Printable

func PrivateKey2Printable(key crypto.PrivateKey) (Jwk, error)

func PublicKey2Printable

func PublicKey2Printable(key crypto.PublicKey) (Jwk, error)

type Jwks

type Jwks struct {
	Keys []Jwk `json:"keys"`
}

func PrivatePEM2Printable

func PrivatePEM2Printable(bytes []byte) (*Jwks, error)

func PublicPEM2Printable

func PublicPEM2Printable(bytes []byte) (*Jwks, error)

Jump to

Keyboard shortcuts

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