// GenerateCertificate provides a certificate from trusted CA to the user. Note that CA
// needs to know the user. The certificate is then used for registering pseudonym (nym).
// The certificate contains blinded user's master key pair and a signature of it.
GenerateCertificate provides a certificate from trusted CA to the user. Note that CA
needs to know the user. The certificate is then used for registering pseudonym (nym).
The certificate contains blinded user's master key pair and a signature of it.
// GenerateCertificate provides a certificate from trusted CA to the user . Note that CA // needs to know the user . The certificate is then used for registering pseudonym ( nym ) . // The certificate contains blinded user ' s master key pair and a signature of it .
func (c *PseudonymsysCAClientEC) GenerateCertificate(userSecret *big.Int, nym *pseudonymsys.PseudonymEC) (
	*pseudonymsys.CACertificateEC, error) {
	if err := c.openStream(c.grpcClient, "GenerateCertificate_EC"); err != nil {
		return nil, err
	}
	defer c.closeStream()
	x := c.prover.GetProofRandomData(userSecret, nym.A)
	pRandomData := pb.SchnorrECProofRandomData{
		X: pb.ToPbECGroupElement(x),
		A: pb.ToPbECGroupElement(nym.A),
		B: pb.ToPbECGroupElement(nym.B),
	}
	initMsg := &pb.Message{
		ClientId: c.id,
		Content: &pb.Message_SchnorrEcProofRandomData{
			&pRandomData,
		},
	}
	resp, err := c.getResponseTo(initMsg)
	if err != nil {
		return nil, err
	}
	ch := resp.GetBigint()
	challenge := new(big.Int).SetBytes(ch.X1)
	z := c.prover.GetProofData(challenge)
	msg := &pb.Message{
		Content: &pb.Message_SchnorrProofData{
			&pb.SchnorrProofData{
				Z: z.Bytes(),
			},
		},
	}
	resp, err = c.getResponseTo(msg)
	if err != nil {
		return nil, err
	}
	cert := resp.GetPseudonymsysCaCertificateEc()
	certificate := pseudonymsys.NewCACertificateEC(
		cert.BlindedA.GetNativeType(),
		cert.BlindedB.GetNativeType(),
		new(big.Int).SetBytes(cert.R), new(big.Int).SetBytes(cert.S))
	if err := c.genericClient.CloseSend(); err != nil {
		return nil, err
	}
	return certificate, nil
}
func ( c * PseudonymsysCAClientEC ) GenerateCertificate ( userSecret * big . Int , nym * pseudonymsys . PseudonymEC ) ( * pseudonymsys . CACertificateEC , error ) { if err := c . openStream ( c . grpcClient , " " ) ; err != nil { return nil , err } defer c . closeStream ( ) x := c . prover . GetProofRandomData ( userSecret , nym . A ) pRandomData := pb . SchnorrECProofRandomData { X : pb . ToPbECGroupElement ( x ) , A : pb . ToPbECGroupElement ( nym . A ) , B : pb . ToPbECGroupElement ( nym . B ) , } initMsg := & pb . Message { ClientId : c . id , Content : & pb . Message_SchnorrEcProofRandomData { & pRandomData , } , } resp , err := c . getResponseTo ( initMsg ) if err != nil { return nil , err } ch := resp . GetBigint ( ) challenge := new ( big . Int ) . SetBytes ( ch . X1 ) z := c . prover . GetProofData ( challenge ) msg := & pb . Message { Content : & pb . Message_SchnorrProofData { & pb . SchnorrProofData { Z : z . Bytes ( ) , } , } , } resp , err = c . getResponseTo ( msg ) if err != nil { return nil , err } cert := resp . GetPseudonymsysCaCertificateEc ( ) certificate := pseudonymsys . NewCACertificateEC ( cert . BlindedA . GetNativeType ( ) , cert . BlindedB . GetNativeType ( ) , new ( big . Int ) . SetBytes ( cert . R ) , new ( big . Int ) . SetBytes ( cert . S ) ) if err := c . genericClient . CloseSend ( ) ; err != nil { return nil , err } return certificate , nil }
GenerateCertificate provides a certificate from trusted CA to the user.
GenerateCertificate provides a certificate from trusted CA to the user .