RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

Strings and Character Sets

This section describes Cert-C's supported string types.

Accepted String Types

When using the Cert-C SDK, you often enter information as a string. Cert-C accepts thirteen kinds of strings.

These strings are listed along with descriptions as VT_*_STRING in the ASN.1 Value Tags section.

Printable String

A printable string is made up of characters that can be printed on any standard printer or computer screen. For instance, the hex Byte string 52 53 41 27 73 20 43 65 72 74 2D 43 translates to RSA's Cert-C.

0x52 is the ASCII character R, 0x20 is the ASCII character SPACE, and so on. However, the list of possible VT_PRINTABLE_STRING characters does not correspond exactly to the ASCII character set, or what you can type on the keyboard. VT_PRINTABLE_STRING characters consist of the following.

A - Z
a - z
0 - 9
SPACE ' ( ) + , - . / : = ?

However, suppose you need to use the hex values 0xCB or 0x16. They (along with many others) do not correspond to standard characters you generally find on a keyboard. These are not VT_PRINTABLE_STRING characters. To use non-printing characters in a string, use the tag VT_UTF8_STRING.

note.gif
UTF-8 is an alternate way of encoding UNICODE characters using a variable number of Bytes per character. It is designed so that 0x00-0x7f corresponds to the standard ASCII characters. Also, 0x00-0x7f does not occur inside any multi-Byte character. This trait enables many routines that use 0x00 as an end-of-string indicator to work, as well as routines that scan occurrences of standard ASCII characters within a string. For European languages (including English), a typical UTF-8-encoded string is shorter than the standard UNICODE-encoded string, which requires a constant two Bytes per character.

Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 067-001001-2720-001-000 - 2.7.2