X509::subject_public_key

Description

Returns the subject’s public key of the specified X509 certificate.

Syntax

X509::subject_public_key <X509 certificate>

v11.5+
X509::subject_public_key type <X509 certificate>
X509::subject_public_key bits <X509 certificate>
X509::subject_public_key curve_name <X509 certificate>

X509::subject_public_key <X509 certificate>

  • Returns the subject’s public key of the specified X509 certificate.

X509::subject_public_key type <X509 certificate>

  • Returns the type of subject public key of the specified X509 certificate e.g. RSA, DSA or EC.

X509::subject_public_key bits <X509 certificate>

  • Returns the size of subject public key in bits of the specified X509 certificate e.g. 2048. Valid for public key type RSA and DSA only. EC public key certificates are not supported by this command.

X509::subject_public_key curve_name <X509 certificate>

  • Returns the curve-name of EC subject public key of the specified X509 certificate. An error message will be show if the certificate is not of type EC.

Examples

when CLIENTSSL_CLIENTCERT {
  set client_cert [SSL::cert 0]
  log local0. "Cert subject - [X509::subject $client_cert]"
  log local0. "Cert public key - [X509::subject_public_key $client_cert]"
}

when CLIENTSSL_CLIENTCERT {
  set client_cert [SSL::cert 0]

  log local0. "key - [X509::subject_public_key $client_cert]"
  log local0. "key type - [X509::subject_public_key type $client_cert]"
  log local0. "key bits - [X509::subject_public_key bits $client_cert]"
  log local0. "key curve_name - [X509::subject_public_key curve_name $client_cert]"
}