RSA BSAFE Crypto-C

Cryptographic Components for C

Search

Encoding

This section outlines the Crypto-C implementation of the BER/DER standard. Much of the data in cryptographic applications needs to be passed between two or more individuals. For example, users may need to transmit a public key, EC parameters, or an algorithm name. Not everyone uses Crypto-C, and how information is processed in Crypto-C may differ from another company's package.

OSI (described in ANSI's X.200) is an internationally standardized architecture that governs the interconnection of computers from the physical layer to the user-application layer. OSI's method of specifying abstract objects is called ASN.1 and is defined in X.680. One set of rules for representing such objects as strings of ones and zeros is called BER, defined in X.680. There is generally more than one way to BER-encode a given value, so another set of rules, called DER, gives a unique encoding to each ASN.1 value. Conversion into BER or DER is known as BER-encoding or DER-encoding.

Crypto-C includes the following samples which demonstrates BER/DER functionality:

To implement BER or DER format, call B_GetAlgorithmInfo() or B_GetKeyInfo() with the BER version of the AI or KI used to set the algorithm or key object. Crypto-C includes numerous Algorithm Identifiers and Key Identifiers which implement BER functionality.

For example, in Basic Crypto-C Encryption and Decryption, the algorithm object was set to AI_RC4. The compatible BER representation is AI_RC4_BER. This AI provides the BER-encoded AI for the RC4 algorithm.

note.gif
BER-encoding does not put data into an ASCII string. The conversion between binary and ASCII is known as encoding and decoding. If the encoding is BER- or DER-encoding, the BER or DER should be explicitly stated. See Converting Data for information on binary and ASCII encoding.


Sections

Algorithm Flags
 Crypto-C enables developers to obtain object information from BER-encoded information or a BER-encoded object.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 068-001001-6210-001-000 - 6.2.1