github.com/hyperledger/aries-framework-go@v0.3.2/pkg/crypto/primitive/bbs12381g2pub/keys.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package bbs12381g2pub
     8  
     9  import (
    10  	"hash"
    11  
    12  	bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub"
    13  )
    14  
    15  // PublicKey defines BLS Public Key.
    16  type PublicKey = bbs.PublicKey
    17  
    18  // PrivateKey defines BLS Public Key.
    19  type PrivateKey = bbs.PrivateKey
    20  
    21  // PublicKeyWithGenerators extends PublicKey with a blinding generator h0, a commitment to the secret key w,
    22  // and a generator for each message h.
    23  type PublicKeyWithGenerators = bbs.PublicKeyWithGenerators
    24  
    25  // UnmarshalPrivateKey unmarshals PrivateKey.
    26  func UnmarshalPrivateKey(privKeyBytes []byte) (*PrivateKey, error) {
    27  	return bbs.UnmarshalPrivateKey(privKeyBytes)
    28  }
    29  
    30  // UnmarshalPublicKey parses a PublicKey from bytes.
    31  func UnmarshalPublicKey(pubKeyBytes []byte) (*PublicKey, error) {
    32  	return bbs.UnmarshalPublicKey(pubKeyBytes)
    33  }
    34  
    35  // GenerateKeyPair generates BBS+ PublicKey and PrivateKey pair.
    36  func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {
    37  	return bbs.GenerateKeyPair(h, seed)
    38  }