Skip to content

Commit d3b7876

Browse files
committed
[FAB-3297] PKCS8Info Version should be 0 and not 1
The Version field of the PKCSInfo structure can be 0 or 1 but it turns out that most implementations actually use 0 and more importantly Java libraries expect it to be 0 as well. This corrects the error. I did not create another JIRA as I'm just correcting the implementation Change-Id: Iae7e1771df3654d097c8873d7c3f967afea9fadf Signed-off-by: Gari Singh <[email protected]>
1 parent 48cd487 commit d3b7876

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bccsp/utils/keys.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error) {
114114
}
115115

116116
var pkcs8Key pkcs8Info
117-
pkcs8Key.Version = 1
117+
pkcs8Key.Version = 0
118118
pkcs8Key.PrivateKeyAlgorithm = make([]asn1.ObjectIdentifier, 2)
119119
pkcs8Key.PrivateKeyAlgorithm[0] = oidPublicKeyECDSA
120120
pkcs8Key.PrivateKeyAlgorithm[1] = oidNamedCurve

0 commit comments

Comments
 (0)