-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aditya Joshi <[email protected]>
- Loading branch information
1 parent
6e71f63
commit e63c7d5
Showing
9 changed files
with
469 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,19 @@ function checkPrereqs() { | |
fi | ||
done | ||
|
||
## check for cfssl binaries | ||
if [ "$CRYPTO" == "cfssl" ]; then | ||
|
||
cfssl version > /dev/null 2>&1 | ||
if [[ $? -ne 0 ]]; then | ||
errorln "cfssl binary not found.." | ||
errorln | ||
errorln "Follow the instructions to install the cfssl and cfssljson binaries:" | ||
errorln "https://github.com/cloudflare/cfssl#installation" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
## Check for fabric-ca | ||
if [ "$CRYPTO" == "Certificate Authorities" ]; then | ||
|
||
|
@@ -182,6 +195,26 @@ function createOrgs() { | |
|
||
fi | ||
|
||
# Create crypto material using cfssl | ||
if [ "$CRYPTO" == "cfssl" ]; then | ||
|
||
. organizations/cfssl/registerEnroll.sh | ||
#function_name cert-type CN org | ||
peer_cert peer peer0.org1.example.com org1 | ||
peer_cert admin [email protected] org1 | ||
|
||
infoln "Creating Org2 Identities" | ||
#function_name cert-type CN org | ||
peer_cert peer peer0.org2.example.com org2 | ||
peer_cert admin [email protected] org2 | ||
|
||
infoln "Creating Orderer Org Identities" | ||
#function_name cert-type CN | ||
orderer_cert orderer orderer.example.com | ||
orderer_cert admin [email protected] | ||
|
||
fi | ||
|
||
# Create crypto material using Fabric CA | ||
if [ "$CRYPTO" == "Certificate Authorities" ]; then | ||
infoln "Generating certificates using Fabric CA" | ||
|
@@ -452,6 +485,9 @@ while [[ $# -ge 1 ]] ; do | |
-ca ) | ||
CRYPTO="Certificate Authorities" | ||
;; | ||
-cfssl ) | ||
CRYPTO="cfssl" | ||
;; | ||
-r ) | ||
MAX_RETRY="$2" | ||
shift | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"CN": "{USER}", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "admin" | ||
} | ||
], | ||
"hosts": [ | ||
"{USER}", | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"CN": "cfssl-orderer-ca", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "client" | ||
} | ||
], | ||
"hosts": [ | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"CN": "cfssl-peer-ca", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "Fabric" | ||
} | ||
], | ||
"hosts": [ | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"signing": { | ||
"default": { | ||
"expiry": "175200h" | ||
}, | ||
"profiles": { | ||
"sign": { | ||
"usages": [ | ||
"signing", | ||
"key encipherment", | ||
"cert sign", | ||
"digital signature" | ||
], | ||
"expiry": "175200h" | ||
}, | ||
"tls": { | ||
"usages": [ | ||
"signing", | ||
"key encipherment", | ||
"server auth", | ||
"client auth" | ||
], | ||
"expiry": "175200h" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"CN": "{USER}", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "client" | ||
} | ||
], | ||
"hosts": [ | ||
"{USER}", | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
22 changes: 22 additions & 0 deletions
22
test-network/organizations/cfssl/orderer-csr-template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"CN": "{USER}", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "orderer" | ||
} | ||
], | ||
"hosts": [ | ||
"{USER}", | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"CN": "{USER}", | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"names": [ | ||
{ | ||
"C": "IN", | ||
"ST": "Delhi", | ||
"L": "Aero city", | ||
"O": "cfssl", | ||
"OU": "peer" | ||
} | ||
], | ||
"hosts": [ | ||
"{USER}", | ||
"localhost", | ||
"127.0.0.1", | ||
"0.0.0.0" | ||
] | ||
} |
Oops, something went wrong.