Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BBSG2SignatureProofVerifier ¶
type BBSG2SignatureProofVerifier struct {
// contains filtered or unexported fields
}
BBSG2SignatureProofVerifier is a signature verifier that verifies a BBS+ Signature Proof taking Bls12381G2Key2020 public key bytes as input. The reference implementation https://github.com/mattrglobal/bls12381-key-pair supports public key bytes only, JWK is not supported.
func NewBBSG2SignatureProofVerifier ¶
func NewBBSG2SignatureProofVerifier(nonce []byte) *BBSG2SignatureProofVerifier
NewBBSG2SignatureProofVerifier creates a new BBSG2SignatureProofVerifier.
type BBSG2SignatureVerifier ¶
type BBSG2SignatureVerifier struct {
// contains filtered or unexported fields
}
BBSG2SignatureVerifier is a signature verifier that verifies a BBS+ Signature taking Bls12381G2Key2020 public key bytes as input. The reference implementation https://github.com/mattrglobal/bls12381-key-pair supports public key bytes only, JWK is not supported.
func NewBBSG2SignatureVerifier ¶
func NewBBSG2SignatureVerifier() *BBSG2SignatureVerifier
NewBBSG2SignatureVerifier creates a new BBSG2SignatureVerifier.
type DocumentVerifier ¶
type DocumentVerifier struct {
// contains filtered or unexported fields
}
DocumentVerifier implements JSON LD document proof verification.
func New ¶
func New(resolver keyResolver, suites ...SignatureSuite) (*DocumentVerifier, error)
New returns new instance of document verifier.
func (*DocumentVerifier) Verify ¶
func (dv *DocumentVerifier) Verify(jsonLdDoc []byte, opts ...jsonld.ProcessorOpts) error
Verify will verify document proofs.
type ECDSASignatureVerifier ¶
type ECDSASignatureVerifier struct {
// contains filtered or unexported fields
}
ECDSASignatureVerifier verifies elliptic curve signatures.
func NewECDSAES256SignatureVerifier ¶
func NewECDSAES256SignatureVerifier() *ECDSASignatureVerifier
NewECDSAES256SignatureVerifier creates a new signature verifier that verifies a ECDSA P-256 signature taking public key bytes and JSON Web Key as input.
func NewECDSAES384SignatureVerifier ¶
func NewECDSAES384SignatureVerifier() *ECDSASignatureVerifier
NewECDSAES384SignatureVerifier creates a new signature verifier that verifies a ECDSA P-384 signature taking public key bytes and JSON Web Key as input.
func NewECDSAES521SignatureVerifier ¶
func NewECDSAES521SignatureVerifier() *ECDSASignatureVerifier
NewECDSAES521SignatureVerifier creates a new signature verifier that verifies a ECDSA P-521 signature taking public key bytes and JSON Web Key as input.
func NewECDSASecp256k1SignatureVerifier ¶
func NewECDSASecp256k1SignatureVerifier() *ECDSASignatureVerifier
NewECDSASecp256k1SignatureVerifier creates a new signature verifier that verifies a ECDSA secp256k1 signature taking public key bytes and JSON Web Key as input.
type Ed25519SignatureVerifier ¶
type Ed25519SignatureVerifier struct {
// contains filtered or unexported fields
}
Ed25519SignatureVerifier verifies a Ed25519 signature taking Ed25519 public key bytes as input.
func NewEd25519SignatureVerifier ¶
func NewEd25519SignatureVerifier() *Ed25519SignatureVerifier
NewEd25519SignatureVerifier creates a new Ed25519SignatureVerifier.
type PublicKeyVerifier ¶
type PublicKeyVerifier struct {
// contains filtered or unexported fields
}
PublicKeyVerifier makes signature verification using the public key based on one or several signature algorithms.
func NewCompositePublicKeyVerifier ¶
func NewCompositePublicKeyVerifier(verifiers []SignatureVerifier, opts ...PublicKeyVerifierOpt) *PublicKeyVerifier
NewCompositePublicKeyVerifier creates a new PublicKeyVerifier based on one or more signature algorithms.
func NewPublicKeyVerifier ¶
func NewPublicKeyVerifier(sigAlg SignatureVerifier, opts ...PublicKeyVerifierOpt) *PublicKeyVerifier
NewPublicKeyVerifier creates a new PublicKeyVerifier based on single signature algorithm.
type PublicKeyVerifierOpt ¶
type PublicKeyVerifierOpt func(opts *PublicKeyVerifier)
PublicKeyVerifierOpt is the PublicKeyVerifier functional option.
func WithExactPublicKeyType ¶
func WithExactPublicKeyType(jwkType string) PublicKeyVerifierOpt
WithExactPublicKeyType option is used to check the type of the PublicKey.
type RSAPS256SignatureVerifier ¶
type RSAPS256SignatureVerifier struct {
// contains filtered or unexported fields
}
RSAPS256SignatureVerifier verifies a Ed25519 signature taking RSA public key bytes as input.
func NewRSAPS256SignatureVerifier ¶
func NewRSAPS256SignatureVerifier() *RSAPS256SignatureVerifier
NewRSAPS256SignatureVerifier creates a new RSAPS256SignatureVerifier.
type SignatureSuite ¶
type SignatureSuite interface { // GetCanonicalDocument will return normalized/canonical version of the document GetCanonicalDocument(doc map[string]interface{}, opts ...jsonld.ProcessorOpts) ([]byte, error) // GetDigest returns document digest GetDigest(doc []byte) []byte // Verify will verify signature against public key Verify(pubKey *PublicKey, doc []byte, signature []byte) error // Accept registers this signature suite with the given signature type Accept(signatureType string) bool // CompactProof indicates weather to compact the proof doc before canonization CompactProof() bool }
SignatureSuite encapsulates signature suite methods required for signature verification.