publickey

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: BSL-1.0 Imports: 0 Imported by: 0

README

Public key implementation

This implementation of public keys differs from the interface crypto provides in that it only handles public keys as a byte slice and also stores a key ID with the key. It is therefore specifically made for JWS / JWK use. Note that it does not implement the JWK standard though.

Working with public keys

New(key []byte, keyID string) PublicKey

key.GetPublicKey() []byte
key.GetKeyID() string

A new public key can be initialized using New with the key as a byte slice and the key ID as a string.

To retrieve the public key slice from a public key, use key.GetPublicKey. The key ID can similarly be retrieved using key.GetKeyID.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey represents a public key

func New

func New(key []byte, id string) PublicKey

New returns a new PublicKey with the arguments as values

func (PublicKey) GetKeyID

func (s PublicKey) GetKeyID() string

GetKeyID returns the keys ID

func (PublicKey) GetPublicKey

func (s PublicKey) GetPublicKey() []byte

GetPublicKey returns the key as a byte slice

Jump to

Keyboard shortcuts

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