Skip to content

Commit 2e0fc28

Browse files
author
Olesja Aarma
committed
RM-4527: Add to CLI readme that only Estonian personal code can be used only
1 parent 608934e commit 2e0fc28

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

cdoc2-cli/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,18 @@ Key and label can be safely stored in a password manager.
121121

122122
### Encryption with Smart ID
123123

124+
Current encryption/decryption implementation of cdoc2 container with Smart ID supports only Estonian
125+
personal ID codes.
126+
124127
```
125128
java -jar target/cdoc2-cli-*.jar create --smart-id=38001085718 -f /tmp/smartid.cdoc README.md
126129
```
127130

128131
Multiple ID codes are allowed to be sent for encryption:
129132

130133
```
131-
java -jar target/cdoc2-cli-*.jar create -sid=38001085718 -sid=47101010033 -f /tmp/smartid.cdoc README.md
134+
java -jar target/cdoc2-cli-*.jar create -sid=38001085718 -sid=47101010033 \
135+
-f /tmp/smartid.cdoc README.md
132136
```
133137

134138
Key shares or Smart-ID properties can be sent externally by adding following options (the same
@@ -143,14 +147,18 @@ and/or
143147

144148
### Encryption with Mobile ID
145149

150+
Current encryption/decryption implementation of cdoc2 container with Mobile ID supports only
151+
Estonian personal ID codes.
152+
146153
```
147154
java -jar target/cdoc2-cli-*.jar create --mobile-id=51307149560 -f /tmp/mobileid.cdoc README.md
148155
```
149156

150157
Multiple ID codes are allowed to be sent for encryption:
151158

152159
```
153-
java -jar target/cdoc2-cli-*.jar create -mid=51307149560 -mid=60001017869 -f /tmp/mobileid.cdoc README.md
160+
java -jar target/cdoc2-cli-*.jar create -mid=51307149560 -mid=60001017869 \
161+
-f /tmp/mobileid.cdoc README.md
154162
```
155163

156164
Key shares or Mobile-ID properties can be sent externally by adding following options (the same
@@ -173,16 +181,17 @@ To decrypt:
173181
java -jar target/cdoc2-cli-*.jar decrypt --file /tmp/mydoc.cdoc -k keys/bob.pem --output /tmp
174182
```
175183

176-
or with Smart-ID:
184+
or with Smart-ID for Estonian personal ID code:
177185

178186
```
179187
java -jar target/cdoc2-cli-*.jar decrypt -sid=38001085718 -f /tmp/smartid.cdoc --output /tmp
180188
```
181189

182-
or with Mobile-ID:
190+
or with Mobile-ID for Estonian personal ID code and Estonian phone number with country code `+372`:
183191

184192
```
185-
java -jar target/cdoc2-cli-*.jar decrypt -mid=51307149560 -mid-phone=+37269930366 -f /tmp/mobileid.cdoc --output /tmp
193+
java -jar target/cdoc2-cli-*.jar decrypt -mid=51307149560 -mid-phone=+37269930366 \
194+
-f /tmp/mobileid.cdoc --output /tmp
186195
```
187196

188197
### Decrypting with server scenario

cdoc2-cli/src/main/java/ee/cyber/cdoc2/cli/util/CDocDecryptionHelper.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ public static DecryptionKeyMaterial getDecryptionKeyMaterial(
129129
return decryptionKm;
130130
}
131131

132+
/**
133+
* @param idCode estonian national identity code
134+
* @param cdocFile cdoc2 file decrypted
135+
* @return DecryptionKeyMaterial object
136+
*/
132137
private static DecryptionKeyMaterial getSidDecryptionKeyMaterial(String idCode, File cdocFile) {
133138
AuthenticationIdentifier authIdentifier = AuthenticationIdentifier.forKeyShares(
134139
createSemanticsIdentifier(idCode), AuthenticationIdentifier.AuthenticationType.SID
@@ -141,18 +146,16 @@ private static DecryptionKeyMaterial getSidDecryptionKeyMaterial(String idCode,
141146
}
142147

143148
/**
144-
*
145149
* @param idCode estonian national identity code
146150
* @param phoneNumber user phone number international format +372...
147151
* @param cdocFile cdoc2 file decrypted
148-
* @return
152+
* @return DecryptionKeyMaterial object
149153
*/
150154
private static DecryptionKeyMaterial getMidDecryptionKeyMaterial(
151155
String idCode,
152156
String phoneNumber,
153157
File cdocFile
154158
) {
155-
156159
AuthenticationIdentifier authIdentifier = AuthenticationIdentifier.forMidDecryption(
157160
createSemanticsIdentifier(idCode),
158161
getValidatedPhoneNumber(phoneNumber)

0 commit comments

Comments
 (0)