laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36962?usp=email )
Change subject: document the CardKeyProvider
......................................................................
document the CardKeyProvider
Change-Id: Ie6fc24695dd956a4f9fd6f243d3b0ef66acf877b
---
A docs/card-key-provider.rst
M docs/shell.rst
2 files changed, 112 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/docs/card-key-provider.rst b/docs/card-key-provider.rst
new file mode 100644
index 0000000..82f2d65
--- /dev/null
+++ b/docs/card-key-provider.rst
@@ -0,0 +1,94 @@
+
+Retrieving card-individual keys via CardKeyProvider
+==================================================
+
+When working with a batch of cards, or more than one card in general, it
+is a lot of effort to manually retrieve the card-specific PIN (like
+ADM1) or key material (like SCP02/SCP03 keys).
+
+To increase productivity in that regard, pySim has a concept called the
+`CardKeyProvider`. This is a generic mechanism by which different parts
+of the pySim[-shell] code can programmatically request card-specific key material
+from some data source (*provider*).
+
+For example, when you want to verify the ADM1 PIN using the `verify_adm`
+command without providing an ADM1 value yourself, pySim-shell will
+request the ADM1 value for the ICCID of the card via the
+CardKeyProvider.
+
+There can in theory be multiple different CardKeyProviders. You can for
+example develop your own CardKeyProvider that queries some kind of
+database for the key material, or that uses a key derivation function to
+derive card-specific key material from a global master key.
+
+The only actual CardKeyProvider implementation included in pySim is the
+`CardKeyProviderCsv` which retrieves the key material from a
+[potentially encrypted] CSV file.
+
+
+The CardKeyProviderCsv
+----------------------
+
+The `CardKeyProviderCsv` allows you to retrieve card-individual key
+material from a CSV (comma separated value) file that is accessible to pySim.
+
+The CSV file must have the expected column names, for example `ICCID`
+and `ADM1` in case you would like to use that CSV to obtain the
+card-specific ADM1 PIN when using the `verify_adm` command.
+
+You can specify the CSV file to use via the `--csv` command-line option
+of pySim-shell. If you do not specify a CSV file, pySim will attempt to
+open a CSV file from the default location at
+`~/.osmocom/pysim/card_data.csv`, and use that, if it exists.
+
+
+Field naming
+------------
+
+* For look-up of UICC/SIM/USIM/ISIM or eSIM profile specific key
+ material, pySim uses the `ICCID` field as lookup key.
+
+* For look-up of eUICC specific key material (like SCP03 keys for the
+ ISD-R, ECASD), pySim uses the `EID` field as lookup key.
+
+As soon as the CardKeyProviderCsv finds a line (row) in your CSV where
+the ICCID or EID match, it looks for the column containing the requested
+data.
+
+
+ADM PIN
+~~~~~~~
+
+The `verify_adm` command will attempt to look up the `ADM1` column
+indexed by the ICCID of the SIM/UICC.
+
+
+SCP02 / SCP03
+~~~~~~~~~~~~~
+
+SCP02 and SCP03 each use key triplets consisting if ENC, MAC and DEK
+keys. For more details, see the applicable GlobalPlatform
+specifications.
+
+If you do not want to manually enter the key material for each specific
+card as arguments to the `establish_scp02` or `establish_scp03`
+commands, you can make use of the `--key-provider-suffix` option. pySim
+uses this suffix to compose the column names for the CardKeyProvider as
+follows.
+
+* `SCP02_ENC_` + suffix for the SCP02 ciphering key
+* `SCP02_MAC_` + suffix for the SCP02 MAC key
+* `SCP02_DEK_` + suffix for the SCP02 DEK key
+* `SCP03_ENC_` + suffix for the SCP03 ciphering key
+* `SCP03_MAC_` + suffix for the SCP03 MAC key
+* `SCP03_DEK_` + suffix for the SCP03 DEK key
+
+So for example, if you are using a command like `establish_scp03
+--key-provider-suffix ISDR`, then the column names for the key material
+look-up are `SCP03_ENC_ISDR`, `SCP03_MAC_ISDR` and `SCP03_DEK_ISDR`,
+respectively.
+
+The identifier used for look-up is determined by the definition of the
+Security Domain. For example, the eUICC ISD-R and ECASD will use the EID
+of the eUICC. On the other hand, the ISD-P of an eSIM or the ISD of an
+UICC will use the ICCID.
diff --git a/docs/shell.rst b/docs/shell.rst
index 084858c..111c502 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -69,6 +69,15 @@
suci-tutorial
+Advanced Topics
+---------------
+.. toctree::
+ :maxdepth: 1
+ :caption: Advanced pySIM-shell topics
+
+ card-key-provider
+
+
cmd2 basics
-----------
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36962?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ie6fc24695dd956a4f9fd6f243d3b0ef66acf877b
Gerrit-Change-Number: 36962
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-uecups/+/37032?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I8b7e80f3227404df5433acc44ebd6e03703248ac
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-uecups refs/changes/32/37032/1
diff --git a/README.md b/README.md
index d7dfa10..5025bc0 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@
Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/37032?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: I8b7e80f3227404df5433acc44ebd6e03703248ac
Gerrit-Change-Number: 37032
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/37031?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I7956cf01ea1944990d05cd76938698b333bd0e67
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/37031/1
diff --git a/README.md b/README.md
index 9361631..7098765 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@
Our coding standards are described at
<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
-We us a gerrit based patch submission/review process for managing contributions.
+We use a Gerrit based patch submission/review process for managing contributions.
Please see <https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit>
for more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/37031?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7956cf01ea1944990d05cd76938698b333bd0e67
Gerrit-Change-Number: 37031
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-smlc/+/37030?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I5cd00ad066223fa33cf76ff1c85fbd810f37062c
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-smlc refs/changes/30/37030/1
diff --git a/README.md b/README.md
index 354e683..84330a1 100644
--- a/README.md
+++ b/README.md
@@ -60,7 +60,7 @@
Our coding standards are described at
<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-smlc/+/37030?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-smlc
Gerrit-Branch: master
Gerrit-Change-Id: I5cd00ad066223fa33cf76ff1c85fbd810f37062c
Gerrit-Change-Number: 37030
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sip-connector/+/37029?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I372e864c322d47bb8a76283222e1c4abb78ff165
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/29/37029/1
diff --git a/README.md b/README.md
index 4064db6..5b02726 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,7 @@
Our coding standards are described at
<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/37029?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I372e864c322d47bb8a76283222e1c4abb78ff165
Gerrit-Change-Number: 37029
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/37028?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: Ia23fdbde29691c7af3834effee3d03ab866ca809
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/28/37028/1
diff --git a/README.md b/README.md
index 3143d04..9be245f 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@
Our coding standards are described at
<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/37028?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ia23fdbde29691c7af3834effee3d03ab866ca809
Gerrit-Change-Number: 37028
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/37027?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: Ia020f1ef3e634af1d58e0d34a92df5e827533629
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/27/37027/1
diff --git a/README.md b/README.md
index 8467c50..45761ea 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@
Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/37027?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ia020f1ef3e634af1d58e0d34a92df5e827533629
Gerrit-Change-Number: 37027
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/37026?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I07bea7a7eedb70edb8dd124a3a6167eb35344b81
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/26/37026/1
diff --git a/README.md b/README.md
index df1cb5f..9261ccc 100644
--- a/README.md
+++ b/README.md
@@ -89,7 +89,7 @@
Our coding standards are described at
<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/37026?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I07bea7a7eedb70edb8dd124a3a6167eb35344b81
Gerrit-Change-Number: 37026
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/37025?usp=email )
Change subject: README.md: cosmetic: fix a typo
......................................................................
README.md: cosmetic: fix a typo
Change-Id: I5a34fd1873e7f5af5bd258e1f90e35a18b725a71
---
M README.md
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/25/37025/1
diff --git a/README.md b/README.md
index deabe1d..d413cce 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@
Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
-We us a gerrit based patch submission/review process for managing
+We use a Gerrit based patch submission/review process for managing
contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/37025?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I5a34fd1873e7f5af5bd258e1f90e35a18b725a71
Gerrit-Change-Number: 37025
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange