-
Notifications
You must be signed in to change notification settings - Fork 1.2k
-
I use the following java code to generate WAPI192 keypair,
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", providerName);
kpg.initialize(new ECGenParameterSpec("wapi192v1"));
KeyPair kp = kpg.generateKeyPair();
The public key generated like this,
-----BEGIN PUBLIC KEY-----
MEkwEwYHKoZIzj0CAQYIKoEc12MBAQEDMgAELE3dc1Zq6xy4NKn3kP6KufuADCyT
DDrCqTQxonRLtrWuE+nMn09OeyVGyQ6lkzto
-----END PUBLIC KEY-----
In ASN1 view,
SEQUENCE {
SEQUENCE {
OBJECT IDENTIFIER ecPublicKey (1 2 840 10045 2 1)
(ANSI X9.62 public key type)
OBJECT IDENTIFIER '1 2 156 11235 1 1 1'
}
BIT STRING 0 unused bits
04 2C 4D DD 73 56 6A EB 1C B8 34 A9 F7 90 FE 8A
B9 FB 80 0C 2C 93 0C 3A C2 A9 34 31 A2 74 4B B6
B5 AE 13 E9 CC 9F 4F 4E 7B 25 46 C9 0E A5 93 3B
68
}
Should the parameter OID be "1.2.156.11235.1.1.2.1" ?
Then I wonder if the signature OID is wrong also.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
This has come up before, have a look at: #1478
We'd welcome further clarity on this.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your reply.
I read #1478, and ligefeiBouncyCastle said " Consequently, we will designate 1.2.156.11235.1.1.1 for the ECDSA-192 algorithm with SHA-256, and allocate 1.2.156.11235.1.1.2.1 to the elliptic curve parameter field." in the end.
- the author did not answer the question, that the curve OID should be 1.2.156.11235.1.1.2.1, the same question as mine. It seemd he explain the difference between 1.2.156.10197.1.301.101 and 1.2.156.11235.1.1.2.1
- In 1.81, the parameter is 1.2.156.11235.1.1.1, not 1.2.156.11235.1.1.2.1. This does not conform to what he said.
Do I make myself clear?
And further more, I am quite confused about the signature methodology. The signature can not be verified by SHA256withECDSA. If anyone knows it, very appreciate.
Beta Was this translation helpful? Give feedback.