Skip to content

Commit e0dc9e3

Browse files
author
Anil Ambati
committed
[FAB-2836] Reformatted revoke section
Reformatted revoke section and added an example on how to get AKI and serial number of a certificate using openssl and to revoke the certificate using them. Change-Id: Ia09a20edcd18afd1c41266aa204cd69e90abbcf1 Signed-off-by: Anil Ambati <[email protected]>
1 parent cacb292 commit e0dc9e3

File tree

1 file changed

+46
-34
lines changed

1 file changed

+46
-34
lines changed

docs/source/Setup/ca-setup.rst

+46-34
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Fabric CA server's configuration file format
236236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
237237

238238
A configuration file can be provided to the server using the ``-c`` or ``--config``
239-
option. If the config option is used and the specified file doesn't exist,
239+
option. If the ``--config`` option is used and the specified file doesn't exist,
240240
a default configuration file (like the one shown below) will be created in the
241241
specified location. However, if no config option was used, it will be created in
242242
the server's home directory (see `Fabric CA Server <#server>`__ section more info).
@@ -371,7 +371,7 @@ the server's home directory (see `Fabric CA Server <#server>`__ section more inf
371371
cn: fabric-ca-server
372372
names:
373373
- C: US
374-
ST: "North Carolina"
374+
ST: North Carolina
375375
L:
376376
O: Hyperledger
377377
OU: Fabric
@@ -434,7 +434,7 @@ the client's home directory (see `Fabric CA Client <#client>`__ section more inf
434434
cn: <<<ENROLLMENT_ID>>>
435435
names:
436436
- C: US
437-
ST: "North Carolina"
437+
ST: North Carolina
438438
L:
439439
O: Hyperledger
440440
OU: Fabric
@@ -452,7 +452,7 @@ the client's home directory (see `Fabric CA Client <#client>`__ section more inf
452452
name:
453453
type:
454454
affiliation:
455-
attributes:
455+
attrs:
456456
- name:
457457
value:
458458

@@ -1022,7 +1022,7 @@ file contains the following:
10221022
name:
10231023
type: user
10241024
affiliation: org1.department1
1025-
attributes:
1025+
attrs:
10261026
- name: hf.Revoker
10271027
value: true
10281028
- name: anotherAttrName
@@ -1111,51 +1111,63 @@ You can issue the reenroll command to renew your enrollment certificate as follo
11111111

11121112
Revoking a certificate or identity
11131113
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1114+
An identity or a certificate can be revoked. Revoking an identity will revoke all
1115+
the certificates owned by the identity and will also prevent the identity from getting
1116+
any new certificates. Revoking a certificate will invalidate a single certificate.
11141117

1115-
In order to revoke a certificate or user, the calling identity must have
1116-
the ``hf.Revoker`` attribute. The revoking identity can only revoke a
1117-
certificate or user that has an affiliation that is equal to or prefixed
1118-
by the revoking identity's affiliation.
1118+
In order to revoke a certificate or an identity, the calling identity must have
1119+
the ``hf.Revoker`` attribute. The revoking identity can only revoke a certificate
1120+
or an identity that has an affiliation that is equal to or prefixed by the revoking
1121+
identity's affiliation.
11191122

1120-
For example, a revoker with affiliation bank.bank\_1 can revoke user
1121-
with bank.bank1.dep1 but can't revoke bank.bank2.
1123+
For example, a revoker with affiliation **orgs.org1** can revoke an identity
1124+
affiliated with **orgs.org1** or **orgs.org1.department1** but can't revoke an
1125+
identity affiliated with **orgs.org2**.
11221126

1123-
You may revoke a specific certificate by specifying its AKI (Authority
1124-
Key Identifier) and its serial number as follows:
1127+
The following command disables an identity and revokes all of the certificates
1128+
associated with the identity. All future requests received by the fabric-ca-server
1129+
from this identity will be rejected.
11251130

11261131
::
11271132

1128-
fabric-ca-client revoke -a xxx -s yyy -r <reason>
1133+
fabric-ca-client revoke -e <enrollment_id> -r <reason>
11291134

1130-
The following command disables a user's identity and also revokes all of
1131-
the certificates associated with the identity. All future requests
1132-
received by the fabric-ca-server from this identity will be rejected.
1135+
The following are the supported reasons that can be specified using ``-r`` flag:
1136+
1137+
1. unspecified
1138+
2. keycompromise
1139+
3. cacompromise
1140+
4. affiliationchange
1141+
5. superseded
1142+
6. cessationofoperation
1143+
7. certificatehold
1144+
8. removefromcrl
1145+
9. privilegewithdrawn
1146+
10. aacompromise
1147+
1148+
For example, the bootstrap admin who is associated with root of the affiliation tree
1149+
can revoke **peer1**'s identity as follows:
11331150

11341151
::
11351152

1136-
fabric-ca-client revoke -e <enrollment_id> -r <reason>
1153+
# export FABRIC_CA_CLIENT_HOME=$HOME/fabric-ca/clients/admin
1154+
# fabric-ca-client revoke -e peer1
11371155

1138-
The following are the supported reasons for revoking that can be
1139-
specified using ``-r`` flag.
1156+
An enrollment certificate that belongs to an identity can be revoked by
1157+
specifying its AKI (Authority Key Identifier) and serial number as follows:
11401158

1141-
| **Reasons:**
1142-
| - unspecified
1143-
| - keycompromise
1144-
| - cacompromise
1145-
| - affiliationchange
1146-
| - superseded
1147-
| - cessationofoperation
1148-
| - certificatehold
1149-
| - removefromcrl
1150-
| - privilegewithdrawn
1151-
| - aacompromise
1159+
::
11521160

1153-
The bootstrap admin can revoke **peer1**'s identity as follows:
1161+
fabric-ca-client revoke -a xxx -s yyy -r <reason>
1162+
1163+
For example, you can get the AKI and the serial number of a certificate using the openssl command
1164+
and pass them to the ``revoke`` command to revoke the said certificate as follows:
11541165

11551166
::
11561167

1157-
# export FABRIC_CA_CLIENT_HOME=$HOME/fabric-ca/clients/admin
1158-
# fabric-ca-client revoke -e peer1
1168+
serial=$(openssl x509 -in userecert.pem -serial -noout | cut -d "=" -f 2)
1169+
aki=$(openssl x509 -in userecert.pem -text | awk '/keyid/ {gsub(/ *keyid:|:/,"",$1);print tolower($0)}')
1170+
fabric-ca-client revoke -s $serial -a $aki -r affiliationchange
11591171

11601172
Enabling TLS
11611173
~~~~~~~~~~~~

0 commit comments

Comments
 (0)