Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

EncodingType enumeration

The EncodingType enumeration specifies the type of encoding applied to a byte array for display purposes.

Syntax


typedef enum EncodingType { 
  XCN_CRYPT_STRING_BASE64HEADER         = 0,
  XCN_CRYPT_STRING_BASE64               = 0x1,
  XCN_CRYPT_STRING_BINARY               = 0x2,
  XCN_CRYPT_STRING_BASE64REQUESTHEADER  = 0x3,
  XCN_CRYPT_STRING_HEX                  = 0x4,
  XCN_CRYPT_STRING_HEXASCII             = 0x5,
  XCN_CRYPT_STRING_BASE64_ANY           = 0x6,
  XCN_CRYPT_STRING_ANY                  = 0x7,
  XCN_CRYPT_STRING_HEX_ANY              = 0x8,
  XCN_CRYPT_STRING_BASE64X509CRLHEADER  = 0x9,
  XCN_CRYPT_STRING_HEXADDR              = 0xa,
  XCN_CRYPT_STRING_HEXASCIIADDR         = 0xb,
  XCN_CRYPT_STRING_HEXRAW               = 0xc,
  XCN_CRYPT_STRING_NOCRLF               = 0x40000000,
  XCN_CRYPT_STRING_NOCR                 = 0x80000000
} EncodingType;

Constants

XCN_CRYPT_STRING_BASE64HEADER

The string is base64 encoded with beginning and ending certificate headers. Base64 is an encoding scheme used to transmit binary data. The data to be encoded is examined three bytes at a time. Every six bits in the 24-bit buffer is used as an index into a text string. The strings used vary depending on the type of data being encoded. The following string is commonly used for Multipurpose Internet Mail Extensions (MIME) email base64 encoding.

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

The following example shows a certificate that is base64 encoded and includes the beginning and ending headers.

-----BEGIN CERTIFICATE-----
MIIBqDCCARECAQAwaTELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRMwEQYD
VQQHEwpMYXNDb2xpbmFzMRIwEAYDVQQKEwlNaWNyb3NvZnQxDjAMBgNVBAsTBUl0
ZWFtMREwDwYDVQQDFAhOVFZPT0RPTzCBnjANBgkqhkiG9w0BAQEFAAOBjAAwgYgC
gYBxmmAWKbLJHg5TuVyjgzWW0JsY5Shaqd7BDWtqhzy4HfRTW22f31rlm8NeSXHn
EhLiwsGgNzWHJ8no1QIYzAgpDR79oqxvgrY4WS3PXT7OLwIDAQABoAAwDQYJKoZI
hvcNAQEEBQADgYEAVcyI4jtnnV6kMiByiq4Xg99yL0U7bIpEwAf3MIZHS7wuNqfY
acfhbRj6VFHT8ObprKGPmqXJvwrBmPrEuCs4Ik6PidAAeEfoaa3naIbM73tTvKN+
WD30lAfGBr8SZixLep4pMIN/wO0eu6f30cBuoPtDnDulNT8AuQHjkJIc8Qc=
-----END CERTIFICATE----- 
XCN_CRYPT_STRING_BASE64

The string is base64 encoded without beginning and ending certificate headers.

XCN_CRYPT_STRING_BINARY

The string is a pure binary sequence. It is not encoded.

XCN_CRYPT_STRING_BASE64REQUESTHEADER

The string is base64 encoded with beginning and ending certificate request headers. This is shown in the following example.

-----BEGIN NEW CERTIFICATE REQUEST-----
MIIDBjCCAm8CAQAwcTERMA8GA1UEAxMIcXV1eC5jb20xDzANBgNVBAsTBkJyYWlu
czEWMBQGA1UEChMNRGV2ZWxvcE1lbnRvcjERMA8GA1UEBxMIVG9ycmFuY2UxEzAR
BgNVBAgTCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQDFUxFtzr170yxptKuGI1590Sta5z2dVElLfjAn+q4T1uZE3DiH
HXNRHW1eS9W2aeMZhRnYRi5U8eOdG3RUO4YXy4B1sqfy5I0qjjySA89ghVd/6JcA
K1nhGJL9FPJ6XKVUNLez7NpSCFlYs5foyTqyxDkHzTnQwRwkkwQ9dlbnfwIDAQAB
oIIBUzAaBgorBgEEAYI3DQIDMQwWCjUuMC4yMTk1LjIwNQYKKwYBBAGCNwIBDjEn
MCUwDgYDVR0PAQH/BAQDAgTwMBMGA1UdJQQMMAoGCCsGAQUFBwMBMIH9BgorBgEE
AYI3DQICMYHuMIHrAgEBHloATQBpAGMAcgBvAHMAbwBmAHQAIABSAFMAQQAgAFMA
QwBoAGEAbgBuAGUAbAAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIA
bwB2AGkAZABlAHIDgYkAXxNuAz6gcBaZUdef8WQ2PAroKMW8sprcKv7QD2encz6/
Wct9DZ5CkGynLGy0f+Lff7ViSDJqxYWaJ68ddqgXyAqIilF63kivPTiC6yxLaNX6
5v3cnKFx4UrUrGXZtub7M7/NuxSipOW0Vv7yCHganypxDyRzp6IhulEnL4APEH4A
AAAAAAAAADANBgkqhkiG9w0BAQUFAAOBgQBljJb1ZhWOwOLfzfHbC3yxGkXDy9w3
NA7uhQOvgntnqmSmdHP9nsM3DnxwaHb3EVxMKbAuLsSRDAE1KGqeamvQ3uFjuuL0
5q4nKhX25LyGFDSc6h1OHcv+0ugZ/9klsiViSeEGpMwllUf057o7q1Vls4HN22vM
wkcejcttDjo3Kw==
-----END NEW CERTIFICATE REQUEST-----
XCN_CRYPT_STRING_HEX

The string is hexadecimal encoded. Each 4-bit nibble of the string is represented as a number between zero and nine or a letter between A and F (or a and f). This is shown in the following example.

3a 20 63 65 72 74 6c 69  62 5c 6c 64 61 70 2e 63
70 70 28 32 31 33 31 29  3a 20 6c 64 61 70 65 72
...
XCN_CRYPT_STRING_HEXASCII

The string is hexadecimal encoded, and the corresponding ASCII characters are displayed. This is shown in the following example.

3a 20 63 65 72 74 6c 69  62 5c 6c 64 61 70 2e 63   : certlib\ldap.c
70 70 28 32 31 33 31 29  3a 20 6c 64 61 70 65 72   pp(2131): ldaper
...
XCN_CRYPT_STRING_BASE64_ANY

The string is base64 encoded. Enumeration values are tried in the following order:

  1. XCN_CRYPT_STRING_BASE64HEADER
  2. XCN_CRYPT_STRING_BASE64
XCN_CRYPT_STRING_ANY

Enumeration values are tried in the following order:

  1. XCN_CRYPT_STRING_BASE64_ANY
  2. XCN_CRYPT_STRING_BINARY

The XCN_CRYPT_STRING_BINARY value always succeeds.

XCN_CRYPT_STRING_HEX_ANY

Enumeration values are tried in the following order:

  1. XCN_CRYPT_STRING_HEXADDR
  2. XCN_CRYPT_STRING_HEXASCIIADDR
  3. XCN_CRYPT_STRING_HEXASCII
  4. XCN_CRYPT_STRING_HEX
XCN_CRYPT_STRING_BASE64X509CRLHEADER

The string is base64 encoded with beginning and ending X.509 certificate revocation list (CRL) headers. This is shown in the following example.

-----BEGIN X509 CRL-----
MIIDBjCCAm8CAQAwcTERMA8GA1UEAxMIcXV1eC5jb20xDzANBgNVBAsTBkJyYWlu
czEWMBQGA1UEChMNRGV2ZWxvcE1lbnRvcjERMA8GA1UEBxMIVG9ycmFuY2UxEzAR
BgNVBAgTCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQDFUxFtzr170yxptKuGI1590Sta5z2dVElLfjAn+q4T1uZE3DiH
HXNRHW1eS9W2aeMZhRnYRi5U8eOdG3RUO4YXy4B1sqfy5I0qjjySA89ghVd/6JcA
K1nhGJL9FPJ6XKVUNLez7NpSCFlYs5foyTqyxDkHzTnQwRwkkwQ9dlbnfwIDAQAB
oIIBUzAaBgorBgEEAYI3DQIDMQwWCjUuMC4yMTk1LjIwNQYKKwYBBAGCNwIBDjEn
MCUwDgYDVR0PAQH/BAQDAgTwMBMGA1UdJQQMMAoGCCsGAQUFBwMBMIH9BgorBgEE
AYI3DQICMYHuMIHrAgEBHloATQBpAGMAcgBvAHMAbwBmAHQAIABSAFMAQQAgAFMA
QwBoAGEAbgBuAGUAbAAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIA
bwB2AGkAZABlAHIDgYkAXxNuAz6gcBaZUdef8WQ2PAroKMW8sprcKv7QD2encz6/
Wct9DZ5CkGynLGy0f+Lff7ViSDJqxYWaJ68ddqgXyAqIilF63kivPTiC6yxLaNX6
5v3cnKFx4UrUrGXZtub7M7/NuxSipOW0Vv7yCHganypxDyRzp6IhulEnL4APEH4A
AAAAAAAAADANBgkqhkiG9w0BAQUFAAOBgQBljJb1ZhWOwOLfzfHbC3yxGkXDy9w3
NA7uhQOvgntnqmSmdHP9nsM3DnxwaHb3EVxMKbAuLsSRDAE1KGqeamvQ3uFjuuL0
5q4nKhX25LyGFDSc6h1OHcv+0ugZ/9klsiViSeEGpMwllUf057o7q1Vls4HN22vM
wkcejcttDjo3Kw==
-----END X509 CRL-----
XCN_CRYPT_STRING_HEXADDR

The string is hexadecimal encoded and displayed as a hexadecimal address. This is shown in the following example.

0000  3a 20 63 65 72 74 6c 69  62 5c 6c 64 61 70 2e 63
0010  70 70 28 32 31 33 31 29  3a 20 6c 64 61 70 65 72
...
XCN_CRYPT_STRING_HEXASCIIADDR

The string is hexadecimal encoded and displayed as a hexadecimal address along with the corresponding ASCII characters. This is shown in the following example.

0000  3a 20 63 65 72 74 6c 69  62 5c 6c 64 61 70 2e 63   : certlib\ldap.c
0010  70 70 28 32 31 33 31 29  3a 20 6c 64 61 70 65 72   pp(2131): ldaper
...
XCN_CRYPT_STRING_HEXRAW

The string is hexadecimal encoded and displayed without punctuation. XCN_CRYPT_STRING_HEXRAW is available only with Windows Vista.

3a20636572746c69625c6c6461702e6370702832313331293a206c6461706572...
XCN_CRYPT_STRING_NOCRLF

Removes carriage return and line feed control characters from the encoded string.

XCN_CRYPT_STRING_NOCR

Removes the carriage return control character from the encoded string.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

CertEnroll.h

See also

CertEnroll Enumerations
CertEnroll Interfaces

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.