Documentation ¶
Index ¶
- Constants
- func AlgorithmID(jwk *jwk.JWK) (string, error)
- func BytesToPublicKey(algorithmID string, input []byte) (jwk.JWK, error)
- func GeneratePrivateKey(algorithmID string) (jwk.JWK, error)
- func GetJWA(jwk jwk.JWK) (string, error)
- func GetPublicKey(privateKey jwk.JWK) jwk.JWK
- func PublicKeyToBytes(publicKey jwk.JWK) ([]byte, error)
- func Sign(payload []byte, jwk jwk.JWK) ([]byte, error)
- func Verify(payload []byte, signature []byte, jwk jwk.JWK) (bool, error)
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 ¶
AlgorithmID returns the algorithm ID for the given jwk.JWK
func BytesToPublicKey ¶
BytesToPublicKey converts the given bytes to a public key based on the algorithm specified by algorithmID.
func GeneratePrivateKey ¶
GeneratePrivateKey generates a private key using the algorithm specified by algorithmID.
func GetPublicKey ¶
GetPublicKey returns the public key corresponding to the given private key.
func PublicKeyToBytes ¶
PublicKeyToBytes converts the provided public key to bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.