diff --git a/README.md b/README.md index 1891f25..7d513a8 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ The environment.json file contains information needed by the client SDK to acces - certPath: file path to EJBCA client authentication certificate - keyPath: file path to private key for EJBCA client authentication certificate - ca: default CA to use for enrollment requests in highest-level scenarios wrapper -- profile: default end entity ptofile to use for enrollment requests in highest-level scenarios wrapper +- certificate_profile: default certificate profile to use for enrollment requests in highest-level scenarios wrapper +- end_entity_profile: default end entity profile to use for enrollment requests in highest-level scenarios wrapper # Example usage: diff --git a/environment.json b/environment.json index f8f4b60..f613c50 100644 --- a/environment.json +++ b/environment.json @@ -6,5 +6,6 @@ "certPath":"/home/jdk/superadmin-ejdca.pem", "keyPath":"/home/jdk/superadmin-ejdca.key", "ca":"myCA", - "profile":"myProfile" + "certificate_profile":"myProfile", + "end_entity_profile":"myProfile" } diff --git a/scenarios.py b/scenarios.py index 1f4547c..dc81f71 100644 --- a/scenarios.py +++ b/scenarios.py @@ -11,14 +11,14 @@ import cryptoOps import random -def addEndEntity(username,password,subject,ca,profile): - ejbcaclient.add({"username": username,"password": password,"subject_dn": subject,"ca_name": ca,"certificate_profile_name": "ENDUSER","end_entity_profile_name": profile,"token": "USERGENERATED","account_binding_id": "1234567890"}) +def addEndEntity(username,password,subject,ca,certificate_profile,end_entity_profile): + ejbcaclient.add({"username": username,"password": password,"subject_dn": subject,"ca_name": ca,"certificate_profile_name": certificate_profile,"end_entity_profile_name": end_entity_profile,"token": "USERGENERATED","account_binding_id": "1234567890"}) def csrEnrollment(subject): csr,key = cryptoOps.createCSR(subject) username = f'python_client_{random.randrange(100000000,1000000000)}' password = f'python_client_{random.randrange(100000000,1000000000)}_{random.randrange(100000000,1000000000)}' - addEndEntity(username,password,subject,ejbcaclient.config["ca"],ejbcaclient.config["profile"]) + addEndEntity(username,password,subject,ejbcaclient.config["ca"],ejbcaclient.config["certificate_profile"],ejbcaclient.config["end_entity_profile"]) cert = ejbcaclient.certificate_request({"certificate_request":csr,"username":username,"password":password}) return cert["certificate"],key