Forum Discussion
eric_haupt1
Nimbostratus
Aug 28, 20197 character extraction from string (Cert subject)
I'm working a solution for an PKI requirement and I need to extract seven alphanumeric characters from the end of a cert subject. An example subject would be: SUBJECT: C=BLAH, O=Barf, OU=Help, ...
Faruk_AYDIN
Altostratus
Sep 01, 2019if the last blank is always before the 7 Chars use the following simple irule line :
set last7Chars [string last " " [X509::subject [SSL::cert 0] end]Otherwise:
set certSubject [X509::subject [SSL::cert 0]]
set lenSubject [string length $certSubject]
set last7Location [expr {$lenSubject - 8}]
set last7Chars [substr $certSubject $last7Location 7]Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
