Skip to content

Commit a916f93

Browse files
author
Luis Sanchez
committedMar 9, 2018
[FAB-8757] add Issuer/Subject field to peer.cert
Adds the Subject field to the template used to create the peer.crt generated for a chaincode. Since the cert is self-signed, this also sets the Issuer field. Change-Id: I4465f3df3415e16dbadaef88c23caf70bf114272 Signed-off-by: Luis Sanchez <sanchezl@us.ibm.com>
1 parent 0c2d6b7 commit a916f93

File tree

1 file changed

+2
-0
lines changed
  • core/chaincode/accesscontrol

1 file changed

+2
-0
lines changed
 

‎core/chaincode/accesscontrol/key.go

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"crypto/elliptic"
1313
"crypto/rand"
1414
"crypto/x509"
15+
"crypto/x509/pkix"
1516
"encoding/base64"
1617
"encoding/pem"
1718
"math/big"
@@ -53,6 +54,7 @@ func newCertTemplate() (x509.Certificate, error) {
5354
return x509.Certificate{}, err
5455
}
5556
return x509.Certificate{
57+
Subject: pkix.Name{SerialNumber: sn.String()},
5658
NotBefore: time.Now().Add(time.Hour * (-24)),
5759
NotAfter: time.Now().Add(time.Hour * 24),
5860
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,

0 commit comments

Comments
 (0)
Please sign in to comment.