scclib
Stable Cloud Computing C++ Library
|
An x.509 directory string is used to store generic names. More...
#include <cert.h>
Public Types | |
enum class | Type { printable , utf8 , universal , bmp , teletex , ia5 , visible } |
Public Member Functions | |
DirectoryString (const std::string &b, DirectoryString::Type t=Type::printable) | |
DirectoryString (const BasePtr &b) | |
int | compare (const DirectoryString &b) const |
Compare two directory strings. More... | |
bool | operator== (const DirectoryString &b) const |
bool | operator!= (const DirectoryString &b) const |
void | parse (BasePtr) |
Parse the string from a base object. More... | |
std::string | str () const |
Descriptive string <chars> <type>. | |
BasePtr | dump () const |
Public Attributes | |
DirectoryString::Type | type |
An x.509 directory string is used to store generic names.
Only printable and utf8 are recommended in compliant x.509 v3, but other types are supported for backwards compatibility. ia5 is used in some root certificates.
https://tools.ietf.org/html/rfc5280#section-4.1.2.4
DirectoryString ::= CHOICE { teletexString TeletexString (SIZE (1..MAX)), printableString PrintableString (SIZE (1..MAX)), universalString UniversalString (SIZE (1..MAX)), utf8String UTF8String (SIZE (1..MAX)), bmpString BMPString (SIZE (1..MAX)) }
ia5 and visible are also supported.
|
inline |
Compare two directory strings.
Strict comparison requires conversion to utf-16 and normalization: https://tools.ietf.org/html/rfc4518
void scc::crypto::DirectoryString::parse | ( | BasePtr | ) |
Parse the string from a base object.
Throws exception if the object is not a string.