dsa

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlgorithmIDSECP256K1 is the algorithm ID for SECP256K1
	AlgorithmIDSECP256K1 = ecdsa.SECP256K1AlgorithmID
	// AlgorithmIDED25519 is the algorithm ID for ED25519
	AlgorithmIDED25519 = eddsa.ED25519AlgorithmID
)

Algorithm IDs for different cryptographic algorithms

Variables

This section is empty.

Functions

func AlgorithmID

func AlgorithmID(jwk *jwk.JWK) (string, error)

AlgorithmID returns the algorithm ID for the given jwk.JWK

func BytesToPublicKey

func BytesToPublicKey(algorithmID string, input []byte) (jwk.JWK, error)

BytesToPublicKey converts the given bytes to a public key based on the algorithm specified by algorithmID.

func GeneratePrivateKey

func GeneratePrivateKey(algorithmID string) (jwk.JWK, error)

GeneratePrivateKey generates a private key using the algorithm specified by algorithmID.

func GetJWA

func GetJWA(jwk jwk.JWK) (string, error)

GetJWA returns the JWA (JSON Web Algorithm) algorithm corresponding to the given key.

func GetPublicKey

func GetPublicKey(privateKey jwk.JWK) jwk.JWK

GetPublicKey returns the public key corresponding to the given private key.

func PublicKeyToBytes

func PublicKeyToBytes(publicKey jwk.JWK) ([]byte, error)

PublicKeyToBytes converts the provided public key to bytes

func Sign

func Sign(payload []byte, jwk jwk.JWK) ([]byte, error)

Sign signs the payload using the given private key.

func Verify

func Verify(payload []byte, signature []byte, jwk jwk.JWK) (bool, error)

Verify verifies the signature of the payload using the given public key.

Types

This section is empty.

Directories

Path Synopsis
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.

Jump to

Keyboard shortcuts

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