Versions in this module Expand all Collapse all v1 v1.0.0 Dec 23, 2023 Changes in this version + const BLS12381G1 + const BLS12381G2 + const Dilithium2 + const Dilithium3 + const Dilithium5 + const Ed25519 + const P224 + const P256 + const P384 + const P521 + const RSA + const RSAKeySize + const SECP256k1 + const SECP256k1ECDSA + const X25519 + func BytesToPrivKey(keyBytes []byte, kt KeyType) (crypto.PrivateKey, error) + func BytesToPubKey(keyBytes []byte, kt KeyType, opts ...Option) (crypto.PublicKey, error) + func GenerateBBSKeyPair() (*bbsg2.PublicKey, *bbsg2.PrivateKey, error) + func GenerateDilithiumKeyPair(m dilithium.Mode) (dilithium.PublicKey, dilithium.PrivateKey, error) + func GenerateEd25519Key() (ed25519.PublicKey, ed25519.PrivateKey, error) + func GenerateKeyByKeyType(kt KeyType) (crypto.PublicKey, crypto.PrivateKey, error) + func GenerateP224Key() (ecdsa.PublicKey, ecdsa.PrivateKey, error) + func GenerateP256Key() (ecdsa.PublicKey, ecdsa.PrivateKey, error) + func GenerateP384Key() (ecdsa.PublicKey, ecdsa.PrivateKey, error) + func GenerateP521Key() (ecdsa.PublicKey, ecdsa.PrivateKey, error) + func GenerateRSA2048Key() (rsa.PublicKey, rsa.PrivateKey, error) + func GenerateSECP256k1Key() (secp.PublicKey, secp.PrivateKey, error) + func GenerateX25519Key() (x25519.PublicKey, x25519.PrivateKey, error) + func GetModeFromDilithiumPrivateKey(privKey dilithium.PrivateKey) (dilithium.Mode, error) + func GetModeFromDilithiumPublicKey(pubKey dilithium.PublicKey) (dilithium.Mode, error) + func IsSupportedKeyType(kt KeyType) bool + func IsSupportedSignatureAlg(sa SignatureAlgorithm) bool + func PrivKeyToBytes(key crypto.PrivateKey) ([]byte, error) + func PubKeyToBytes(key crypto.PublicKey, opts ...Option) ([]byte, error) + func SECP256k1ECDSAPubKeyToSECP256k1(key ecdsa.PublicKey) secp.PublicKey + func SECP256k1ECDSASPrivKeyToSECP256k1(key ecdsa.PrivateKey) secp.PrivateKey + func SignBBSMessage(privKey *bbsg2.PrivateKey, messages ...[]byte) ([]byte, error) + func VerifyBBSMessage(pubKey *bbsg2.PublicKey, signature, message []byte) error + func VerifyDerivedBBSMessage(pubKey *bbsg2.PublicKey, signature, message, nonce []byte) error + type BBSPlusSigner struct + func NewBBSPlusSigner(kid string, privKey *bbsg2.PrivateKey) *BBSPlusSigner + func (s *BBSPlusSigner) GetKeyID() string + func (s *BBSPlusSigner) GetVerifier() *BBSPlusVerifier + func (s *BBSPlusSigner) Sign(message []byte) ([]byte, error) + func (s *BBSPlusSigner) SignMultiple(messages ...[]byte) ([]byte, error) + type BBSPlusVerifier struct + KID string + func NewBBSPlusVerifier(kid string, pubKey *bbsg2.PublicKey) *BBSPlusVerifier + func (v *BBSPlusVerifier) DeriveProof(messages [][]byte, sigBytes, nonce []byte, revealedIndexes []int) ([]byte, error) + func (v *BBSPlusVerifier) GetKeyID() string + func (v *BBSPlusVerifier) Verify(message, signature []byte) error + func (v *BBSPlusVerifier) VerifyDerived(message, signature, nonce []byte) error + func (v *BBSPlusVerifier) VerifyMultiple(signature []byte, messages ...[]byte) error + type HashType string + const SHA256 + type KeyType string + func GetExperimentalKeyTypes() []KeyType + func GetKeyTypeFromPrivateKey(key crypto.PrivateKey) (KeyType, error) + func GetSupportedJWKKeyTypes() []KeyType + func GetSupportedKeyTypes() []KeyType + func (kt KeyType) String() string + type Option int + const ECDSAMarshalCompressed + const ECDSAUnmarshalCompressed + type Proof any + type SignatureAlgorithm string + const Dilithium2Sig + const Dilithium3Sig + const Dilithium5Sig + const ES256 + const ES256K + const ES384 + const EdDSA + const PS256 + func GetExperimentalSignatureAlgs() []SignatureAlgorithm + func GetSupportedSignatureAlgs() []SignatureAlgorithm