Skip to content

Commit 48a030d

Browse files
committed
Clear up SSH key example
1 parent 10ef4e6 commit 48a030d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

example/example.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ async def create_ssh_key_item(client: Client):
234234
)
235235

236236
# Serialize the private key in PKCS8 format (PEM)
237-
private_pem = private_key.private_bytes(
237+
ssh_key_pkcs8_pem = private_key.private_bytes(
238238
encoding=serialization.Encoding.PEM,
239239
format=serialization.PrivateFormat.PKCS8,
240240
encryption_algorithm=serialization.NoEncryption()
@@ -251,22 +251,22 @@ async def create_ssh_key_item(client: Client):
251251
id="private_key",
252252
title="private key",
253253
field_type=ItemFieldType.SSHKEY,
254-
value=private_pem,
254+
value=ssh_key_pkcs8_pem,
255255
sectionId="",
256256
),
257257
],
258258
sections=[
259259
ItemSection(id="", title=""),
260-
ItemSection(id="totpsection", title=""),
261260
],
262261
)
263262
created_item = await client.items.create(to_create)
263+
264+
print(created_item.fields[0].value)
265+
print(created_item.fields[0].details.content.public_key)
266+
print(created_item.fields[0].details.content.fingerprint)
267+
print(created_item.fields[0].details.content.key_type)
264268
# [developer-docs.sdk.python.create-sshkey-item]-end
265269

266-
print(f"Private Key is: {created_item.fields[0].value}")
267-
print(f"Public Key is: {created_item.fields[0].details.content.public_key}")
268-
print(f"Fingerprint is: {created_item.fields[0].details.content.fingerprint}")
269-
print(f"Key Type is: {created_item.fields[0].details.content.key_type}")
270270

271271
async def create_and_replace_document_item(client: Client):
272272
# [developer-docs.sdk.python.create-document-item]-start

0 commit comments

Comments
 (0)