Start to implement devices enrollment
This commit is contained in:
@@ -21,7 +21,6 @@ with open(args.secure_origin_path, "r") as f:
|
||||
print(f"Secure origin = {args.secure_origin}")
|
||||
|
||||
|
||||
|
||||
print("Check system root CA")
|
||||
if not os.path.isfile(args.root_ca_path):
|
||||
origin = api.get_root_ca()
|
||||
@@ -43,3 +42,12 @@ if not os.path.isfile(args.dev_csr_path):
|
||||
csr = pki.gen_csr(priv_key=priv_key, cn=f"PyDev {utils.rand_str(10)}")
|
||||
with open(args.dev_csr_path, "w") as f:
|
||||
f.write(csr)
|
||||
|
||||
print("Check device enrollment...")
|
||||
if not os.path.isfile(args.dev_crt_path):
|
||||
with open(args.dev_csr_path, "r") as f:
|
||||
csr = "".join(f.read())
|
||||
|
||||
print("Enrolling device...")
|
||||
crt = api.enroll_device(csr)
|
||||
print("res" + crt)
|
||||
|
||||
Reference in New Issue
Block a user