github.com/hyperledger/aries-framework-go@v0.3.2/pkg/doc/signature/suite/jsonwebsignature2020/jsonwebsignature2020.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  SPDX-License-Identifier: Apache-2.0
     4  */
     5  
     6  // Package jsonwebsignature2020 implements the JsonWebSignature2020 signature suite
     7  // for the Linked Data Signatures specification (https://github.com/transmute-industries/lds-jws2020).
     8  // It uses the RDF Dataset Normalization Algorithm
     9  // to transform the input document into its canonical form.
    10  // It uses SHA-256 [RFC6234] as the message digest algorithm.
    11  // Supported signature algorithms depend on the signer/verifier provided as options to the New().
    12  // According to the suite specification, signer/verifier must support the following algorithms:
    13  // kty | crvOrSize | alg
    14  // OKP | Ed25519   | EdDSA
    15  // EC  | secp256k1 | ES256K
    16  // RSA | 2048      | PS256
    17  // EC  | P-256     | ES256
    18  // EC  | P-384     | ES384
    19  // EC  | P-521     | ES512
    20  package jsonwebsignature2020
    21  
    22  import (
    23  	"github.com/hyperledger/aries-framework-go/component/models/signature/suite"
    24  	"github.com/hyperledger/aries-framework-go/component/models/signature/suite/jsonwebsignature2020"
    25  	"github.com/hyperledger/aries-framework-go/component/models/signature/verifier"
    26  )
    27  
    28  // Suite implements jsonWebSignature2020 signature suite.
    29  type Suite = jsonwebsignature2020.Suite
    30  
    31  // New an instance of Linked Data Signatures for JWS suite.
    32  func New(opts ...suite.Opt) *Suite {
    33  	return jsonwebsignature2020.New(opts...)
    34  }
    35  
    36  // NewPublicKeyVerifier creates a signature verifier that verifies a Ed25519 / EC (P-256, P-384, P-521, secp256k1) / RSA
    37  // signature taking public key bytes and / or JSON Web Key as input.
    38  // The list of Supported JWS algorithms of JsonWebSignature2020 is defined here:
    39  // https://github.com/transmute-industries/lds-jws2020#supported-jws-algs
    40  func NewPublicKeyVerifier() *verifier.PublicKeyVerifier {
    41  	return jsonwebsignature2020.NewPublicKeyVerifier()
    42  }