github.com/simranvc/fabric-ca@v0.0.0-20191030094829-acc364294dde/lib/keyrequestnopkcs11.go (about)

     1  // +build !pkcs11
     2  
     3  /*
     4  Copyright IBM Corp. All Rights Reserved.
     5  
     6  SPDX-License-Identifier: Apache-2.0
     7  */
     8  
     9  package lib
    10  
    11  import "github.com/hyperledger/fabric-ca/api"
    12  
    13  // GetKeyRequest constructs and returns api.BasicKeyRequest object based on the bccsp
    14  // configuration options
    15  func GetKeyRequest(cfg *CAConfig) *api.BasicKeyRequest {
    16  	if cfg.CSP.SwOpts != nil {
    17  		return &api.BasicKeyRequest{Algo: "ecdsa", Size: cfg.CSP.SwOpts.SecLevel}
    18  	}
    19  	return api.NewBasicKeyRequest()
    20  }