Unbound Tech functions

Certificate X509 Self Sign

pypkcs11.unbound.dyc_self_sign_x509(h_session, h_key, hash_alg, subject, serial=None, days=365)

Wrapper for Unbound X509 Self Sign function

Parameters:
  • h_session (int) – Current session
  • h_key (int) – The key handle to sign with
  • hash_alg (int) – Hashing algorithm mechanism type
  • subject (string) – Certificate subject string
  • serial (bytes) – Certificate serial number
  • days (int) – Number of days
Returns:

(Retcode, Python bytestring of self signed X509 certificate)

Return type:

tuple

Call example: ret, x509 = dyc_self_sign_x509(session, priv_key, CKM_SHA256, ‘CN=some guy, L=around, C=US’)

Certificate X509 Sign

pypkcs11.unbound.dyc_sign_x509(h_session, h_key, x509CA, hash_alg, csr, serial=None, days=365)

Wrapper for Unbound X509 Sign function

Parameters:
  • h_session (int) – Current session
  • h_key (int) – The key handle to sign with
  • hash_alg (int) – Hashing algorithm mechanism type
  • x509CA (bytes) – CA Certificate
  • csr (bytes) – Certificate Sign Request
  • serial (bytes) – Certificate serial number
Returns:

(Retcode, Python bytestring of signed X509 certificate)

Return type:

tuple

Create X509 Certificate Sign Request

pypkcs11.unbound.dyc_create_x509_request(h_session, h_key, hash_alg, subject)

Wrapper for Unbound Create X509 Certificate Signing Request function

Parameters:
  • h_session (int) – Current session
  • h_key (int) – The key handle to sign with
  • hash_alg (int) – Hashing algorithm mechanism type
  • subject (string) – Certificate subject string
Returns:

(Retcode, Python bytestring of X509 CSR)

Return type:

tuple