Hi, Can anybody help me to solve this problem, or may be anyone encountered this error:
I need to create *PKCS10* request with *EC keypairs*. But there is an error with request public key every time, I use BC sample test codes for testing below too: X9ECParameters x9 = ECNamedCurveTable.GetByName("secp521r1"); ECCurve curve = x9.Curve; ECDomainParameters spec = new ECDomainParameters(curve, x9.G, x9.N, x9.H); ECPrivateKeyParameters privKey = new ECPrivateKeyParameters( new BigInteger("5769183828869504557786041598510887460263120754767955773309066354712783118202294874205844512909370791582896372147797293913785865682804434049019366394746072023"), // d spec); ECPublicKeyParameters pubKey = new ECPublicKeyParameters( // curve.DecodePoint(Hex.Decode("026BFDD2C9278B63C92D6624F151C9D7A822CC75BD983B17D25D74C26740380022D3D8FAF304781E416175EADF4ED6E2B47142D2454A7AC7801DD803CF44A4D1F0AC")), // Q curve.DecodePoint(Hex.Decode("02006BFDD2C9278B63C92D6624F151C9D7A822CC75BD983B17D25D74C26740380022D3D8FAF304781E416175EADF4ED6E2B47142D2454A7AC7801DD803CF44A4D1F0AC")), // Q spec); Pkcs10CertificationRequest req = new Pkcs10CertificationRequest( algorithm, new X509Name("CN=XXX"), pubKey, null, privKey); if (!req.Verify()) { //Fail("Failed Verify check EC."); } But when i save the PKCS10request as Base64string and open with certutil i encountered such error: "Signature does not match Public key: 8009310b Cannot decode object: ASN1 bad tag value met. 0x8009310b (ASN: 267) CertUtil: -dump command FAILED: 0x8009310b (ASN: 267) CertUtil: ASN1 bad tag value met." And the lenght of public key is 0 "Public Key Length: 0 bits" With RSA key pair there was not such problem. May be anyone has encountered such error? Thanks in advance! -- Best regards ****************** Uzeyir G. Gurbanly Mobile: +994 55 6503505 Mail: uzey...@gmail.com