scclib
Stable Cloud Computing C++ Library
Public Types | Public Member Functions | Public Attributes | List of all members
scc::crypto::DirectoryString Struct Reference

An x.509 directory string is used to store generic names. More...

#include <cert.h>

Inheritance diagram for scc::crypto::DirectoryString:
Inheritance graph
[legend]
Collaboration diagram for scc::crypto::DirectoryString:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Definition at line 325 of file cert.h.

Member Function Documentation

◆ compare()

int scc::crypto::DirectoryString::compare ( const DirectoryString b) const
inline

Compare two directory strings.

Strict comparison requires conversion to utf-16 and normalization: https://tools.ietf.org/html/rfc4518

Definition at line 355 of file cert.h.

◆ parse()

void scc::crypto::DirectoryString::parse ( BasePtr  )

Parse the string from a base object.

Throws exception if the object is not a string.


The documentation for this struct was generated from the following file: