cryptoutil

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ECDSAKeyMatches

func ECDSAKeyMatches(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) bool

func ECDSAPublicKeyEqual

func ECDSAPublicKeyEqual(a, b *ecdsa.PublicKey) bool

func GenerateKey

func GenerateKey(ctx context.Context, km keymanager.KeyManager, keyID string, keyType keymanager.KeyType) (crypto.PublicKey, error)

func GenerateKeyRaw

func GenerateKeyRaw(ctx context.Context, km keymanager.KeyManager, keyID string, keyType keymanager.KeyType) ([]byte, error)

func GetPublicKey

func GetPublicKey(ctx context.Context, km keymanager.KeyManager, keyID string) (crypto.PublicKey, error)

func KeyMatches

func KeyMatches(privateKey crypto.PrivateKey, publicKey crypto.PublicKey) (bool, error)

func PublicKeyEqual

func PublicKeyEqual(a, b crypto.PublicKey) (bool, error)

func RSAKeyMatches

func RSAKeyMatches(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) bool

func RSAPublicKeyEqual

func RSAPublicKeyEqual(a, b *rsa.PublicKey) bool

Types

type KeyManagerSigner

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

func GenerateKeyAndSigner

func GenerateKeyAndSigner(ctx context.Context, km keymanager.KeyManager, keyID string, keyType keymanager.KeyType) (*KeyManagerSigner, error)

func NewKeyManagerSigner

func NewKeyManagerSigner(km keymanager.KeyManager, keyID string, publicKey crypto.PublicKey) *KeyManagerSigner

func (*KeyManagerSigner) KeyID

func (s *KeyManagerSigner) KeyID() string

func (*KeyManagerSigner) Public

func (s *KeyManagerSigner) Public() crypto.PublicKey

func (*KeyManagerSigner) Sign

func (s *KeyManagerSigner) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

func (*KeyManagerSigner) SignContext

func (s *KeyManagerSigner) SignContext(ctx context.Context, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Jump to

Keyboard shortcuts

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