func NewKeyRequest() *KeyRequest {
	bkr := csr.NewKeyRequest()
	return &KeyRequest{Algo: bkr.A, Size: bkr.S}
}
NewKeyRequest returns the KeyRequest object that is constructed
from the object returned by the csr.NewKeyRequest() function
package api
import (
	"time"
	"github.com/cloudflare/cfssl/csr"
	"github.com/kfsoftware/hlf-operator/internal/github.com/hyperledger/fabric-ca/sdkinternal/pkg/util"
)
type RegistrationRequest struct {
	Name string `json:"id" help:"Unique name of the identity"`
	Type string `json:"type" def:"client" help:"Type of identity being registered (e.g. 'peer, app, user')"`
	Secret string `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity being registered"`
	MaxEnrollments int `json:"max_enrollments,omitempty" help:"The maximum number of times the secret can be reused to enroll (default CA's Max Enrollment)"`
	Affiliation string `json:"affiliation" help:"The identity's affiliation"`
	Attributes []Attribute `json:"attrs,omitempty"`
	CAName string `json:"caname,omitempty" skip:"true"`
}
func (rr *RegistrationRequest) String() string {
	return util.StructToString(rr)
}
type RegistrationResponse struct {
	Secret string `json:"secret"`
}
type EnrollmentRequest struct {
	Name string `json:"name" skip:"true"`
	Secret string `json:"secret,omitempty" skip:"true" mask:"password"`
	CAName string `json:"caname,omitempty" skip:"true"`
	AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"`
	Profile string `json:"profile,omitempty" help:"Name of the signing profile to use in issuing the certificate"`
	Label string `json:"label,omitempty" help:"Label to use in HSM operations"`
	CSR *CSRInfo `json:"csr,omitempty" skip:"true"`  
	Type string `def:"x509" help:"The type of enrollment request: 'x509' or 'idemix'"`
}
func (er EnrollmentRequest) String() string {
	return util.StructToString(&er)
}
type ReenrollmentRequest struct {
	Profile string `json:"profile,omitempty"`
	Label string `json:"label,omitempty"`
	CSR *CSRInfo `json:"csr,omitempty"`
	CAName string `json:"caname,omitempty" skip:"true"`
	AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"`
}
type RevocationRequest struct {
	Name string `json:"id,omitempty" opt:"e" help:"Identity whose certificates should be revoked"`
	Serial string `json:"serial,omitempty" opt:"s" help:"Serial number of the certificate to be revoked"`
	AKI string `json:"aki,omitempty" opt:"a" help:"AKI (Authority Key Identifier) of the certificate to be revoked"`
	Reason string `json:"reason,omitempty" opt:"r" help:"Reason for revocation"`
	CAName string `json:"caname,omitempty" skip:"true"`
	GenCRL bool `def:"false" skip:"true" json:"gencrl,omitempty"`
}
type RevocationResponse struct {
	RevokedCerts []RevokedCert
	CRL []byte
}
type RevokedCert struct {
	Serial string
	AKI string
}
type GetCAInfoRequest struct {
	CAName string `json:"caname,omitempty" skip:"true"`
}
type GenCRLRequest struct {
	CAName        string    `json:"caname,omitempty" skip:"true"`
	RevokedAfter  time.Time `json:"revokedafter,omitempty"`
	RevokedBefore time.Time `json:"revokedbefore,omitempty"`
	ExpireAfter   time.Time `json:"expireafter,omitempty"`
	ExpireBefore  time.Time `json:"expirebefore,omitempty"`
}
type GenCRLResponse struct {
	CRL []byte
}
type GetCRIRequest struct {
	CAName string `json:"caname,omitempty" skip:"true"`
}
type GetCRIResponse struct {
	CRI string
}
type AddIdentityRequest struct {
	ID             string      `json:"id" skip:"true"`
	Type           string      `json:"type" def:"user" help:"Type of identity being registered (e.g. 'peer, app, user')"`
	Affiliation    string      `json:"affiliation" help:"The identity's affiliation"`
	Attributes     []Attribute `json:"attrs" mapstructure:"attrs" `
	MaxEnrollments int         `json:"max_enrollments" mapstructure:"max_enrollments" help:"The maximum number of times the secret can be reused to enroll (default CA's Max Enrollment)"`
	Secret string `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity being added"`
	CAName string `json:"caname,omitempty" skip:"true"`
}
type ModifyIdentityRequest struct {
	ID             string      `skip:"true"`
	Type           string      `json:"type" help:"Type of identity being registered (e.g. 'peer, app, user')"`
	Affiliation    string      `json:"affiliation" help:"The identity's affiliation"`
	Attributes     []Attribute `mapstructure:"attrs" json:"attrs"`
	MaxEnrollments int         `mapstructure:"max_enrollments" json:"max_enrollments" help:"The maximum number of times the secret can be reused to enroll"`
	Secret         string      `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity"`
	CAName         string      `json:"caname,omitempty" skip:"true"`
}
type RemoveIdentityRequest struct {
	ID     string `skip:"true"`
	Force  bool   `json:"force"`
	CAName string `json:"caname,omitempty" skip:"true"`
}
type GetIDResponse struct {
	ID             string      `json:"id" skip:"true"`
	Type           string      `json:"type" def:"user"`
	Affiliation    string      `json:"affiliation"`
	Attributes     []Attribute `json:"attrs" mapstructure:"attrs" `
	MaxEnrollments int         `json:"max_enrollments" mapstructure:"max_enrollments"`
	CAName         string      `json:"caname,omitempty"`
}
type GetAllIDsResponse struct {
	Identities []IdentityInfo `json:"identities"`
	CAName     string         `json:"caname,omitempty"`
}
type IdentityResponse struct {
	ID             string      `json:"id" skip:"true"`
	Type           string      `json:"type,omitempty"`
	Affiliation    string      `json:"affiliation"`
	Attributes     []Attribute `json:"attrs,omitempty" mapstructure:"attrs"`
	MaxEnrollments int         `json:"max_enrollments,omitempty" mapstructure:"max_enrollments"`
	Secret         string      `json:"secret,omitempty"`
	CAName         string      `json:"caname,omitempty"`
}
type IdentityInfo struct {
	ID             string      `json:"id"`
	Type           string      `json:"type"`
	Affiliation    string      `json:"affiliation"`
	Attributes     []Attribute `json:"attrs" mapstructure:"attrs"`
	MaxEnrollments int         `json:"max_enrollments" mapstructure:"max_enrollments"`
}
type AddAffiliationRequest struct {
	Name   string `json:"name"`
	Force  bool   `json:"force"`
	CAName string `json:"caname,omitempty"`
}
type ModifyAffiliationRequest struct {
	Name    string
	NewName string `json:"name"`
	Force   bool   `json:"force"`
	CAName  string `json:"caname,omitempty"`
}
type RemoveAffiliationRequest struct {
	Name   string
	Force  bool   `json:"force"`
	CAName string `json:"caname,omitempty"`
}
type AffiliationResponse struct {
	AffiliationInfo `mapstructure:",squash"`
	CAName          string `json:"caname,omitempty"`
}
type AffiliationInfo struct {
	Name         string            `json:"name"`
	Affiliations []AffiliationInfo `json:"affiliations,omitempty"`
	Identities   []IdentityInfo    `json:"identities,omitempty"`
}
type CSRInfo struct {
	CN           string        `json:"CN"`
	Names        []csr.Name    `json:"names,omitempty"`
	Hosts        []string      `json:"hosts,omitempty"`
	KeyRequest   *KeyRequest   `json:"key,omitempty"`
	CA           *csr.CAConfig `json:"ca,omitempty" hide:"true"`
	SerialNumber string        `json:"serial_number,omitempty"`
}
type GetCertificatesRequest struct {
	ID         string    `skip:"true"`                                     
	AKI        string    `help:"Get certificates for this AKI"`            
	Serial     string    `help:"Get certificates for this serial number"`  
	Revoked    TimeRange `skip:"true"`                                     
	Expired    TimeRange `skip:"true"`                                     
	NotExpired bool      `help:"Don't return expired certificates"`        
	NotRevoked bool      `help:"Don't return revoked certificates"`        
	CAName     string    `skip:"true"`                                     
}
type CertificateResponse struct {
	Certs []string `json:"certs"`
}
type TimeRange struct {
	StartTime string
	EndTime   string
}
type KeyRequest struct {
	Algo string `json:"algo" yaml:"algo" help:"Specify key algorithm"`
	Size int    `json:"size" yaml:"size" help:"Specify key size"`
}
type Attribute struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	ECert bool   `json:"ecert,omitempty"`
}
func (a *Attribute) GetName() string {
	return a.Name
}
func (a *Attribute) GetValue() string {
	return a.Value
}
type AttributeRequest struct {
	Name     string `json:"name"`
	Optional bool   `json:"optional,omitempty"`
}
func (ar *AttributeRequest) GetName() string {
	return ar.Name
}
func (ar *AttributeRequest) IsRequired() bool {
	return !ar.Optional
}