sync toc
CryptoSys PKI Manual
Introduction to CryptoSys PKI
Getting Started
Changes in this version
Changes in earlier versions
Conventions in this document
Copyright Notice
Theory
Supported Algorithms
Unsupported algorithms
Key Storage Format
Installation
Win64 (X64) Platform
Detecting Win32 or X64 platform
Visual Basic or Visual Basic: VB6 vs VB.NET
General Programming Issues
Return Values
'Hello world' programs
Converting strings to bytes and vice versa
Converting VB6 to VB.NET
Using with Classic Visual Basic and VBA
Pre-dimensioning for VB6
Using with C and C++
Type Conversions
Compiling with C
Using With Borland C++
Using With MinGW gcc
Cautions for C/C++ Users
Examples of C code
Using with .NET: C# and VB.NET
UTF-8 and Latin-1
Security Issues
Key Security
Internal key strings
Security options for encrypted private keys
Technical Details
Self-Tests
Power-up Self-Tests
Cryptographic algorithm test:
RNG health test:
Software integrity test:
Conditional Tests
Pair-wise consistency test:
Continuous random number generator test:
Action if a self-test fails
Critical Errors
Optional Registry Settings
Random Number Generator
RNG Mechanisms
Techniques to add known security strength to the RNG process
User-supplied entropy (seeds)
Specifying Distinguished Names
UTF-8 encoding in distinguished names
Entering values that include the semi-colon and equals sign
X.509 Extensions Parameter
AOC policy for X.509 content
ISO 8601 date-time formats
Base64 alternative for X.509 certificates
PEM string alternative for X.509 certificates, RSA keys, etc
Base64 and PEM string alternatives for CMS objects
Specifying the algorithm and mode for generic block cipher functions
Valid key and block sizes for block cipher algorithms
AUTACK messages and ISO/IEC 9796-1 signatures
ISO/IEC 9796-1 Formatting
RSA2 Signing
CMS Content Types
CMS SignedData objects
Using in MIME-conformant email messages
Raw RSA Techniques
VB6/C Function Summary
Block Cipher Functions
CMS functions
Encoding conversion functions
Certificate Revocation List (CRL) functions
General functions
Message Digest Hash Functions
HMAC Functions
OCSP Functions
Padding functions
PEM/binary file conversion functions
PFX Functions
Password prompt functions
Random number generator functions
RSA key functions
Raw RSA functions
Triple DES (TDEA/3DES) Functions
Wipe functions
X.509 certificate functions
List of Functions
CIPHER_Bytes
CIPHER_File
CIPHER_Hex
CIPHER_KeyWrap
CIPHER_KeyUnwrap
CMS_GetSigDataDigest
CMS_MakeDetachedSig
CMS_MakeEnvData
CMS_MakeEnvDataFromString
CMS_MakeSigData
CMS_MakeSigDataFromSigValue
CMS_MakeSigDataFromString
CMS_QueryEnvData
CMS_QuerySigData
CMS_ReadEnvData
CMS_ReadEnvDataToString
CMS_ReadSigData
CMS_ReadSigDataToString
CMS_VerifySigData
CNV_B64Filter
CNV_B64StrFromBytes
CNV_ByteEncoding
CNV_BytesFromB64Str
CNV_BytesFromHexStr
CNV_CheckUTF8
CNV_CheckUTF8Bytes
CNV_HexFilter
CNV_HexStrFromBytes
CNV_Latin1FromUTF8
CNV_Latin1FromUTF8Bytes
CNV_UTF8FromLatin1
CNV_UTF8BytesFromLatin1
HASH_Bytes
HASH_File
HASH_HexFromBytes
HASH_HexFromFile
HASH_HexFromHex
HMAC_Bytes
HMAC_HexFromBytes
HMAC_HexFromHex
OCSP_MakeRequest
OCSP_ReadResponse
PAD_BytesBlock
PAD_HexBlock
PAD_UnpadBytes
PAD_UnpadHex
PEM_FileFromBinFile
PEM_FileToBinFile
PFX_MakeFile
PFX_VerifySig
PKI_CompileTime
PKI_ErrorCode
PKI_ErrorLookup
PKI_LastError
PKI_LicenceType
PKI_ModuleName
PKI_PowerUpTests
PKI_Version
PWD_Prompt
PWD_PromptEx
RNG_Bytes
RNG_BytesWithPrompt
RNG_Initialize
RNG_MakeSeedFile
RNG_Number
RNG_String
RNG_StringWithPrompt
RNG_Test
RNG_UpdateSeedFile
RSA_CheckKey
RSA_DecodeMsg
RSA_EncodeMsg
RSA_FromXMLString
RSA_GetPrivateKeyFromPFX
RSA_GetPublicKeyFromCert
RSA_KeyBits
RSA_KeyBytes
RSA_KeyHashCode
RSA_KeyMatch
RSA_MakeKeys
RSA_RawPrivate
RSA_RawPublic
RSA_ReadEncPrivateKey
RSA_ReadPrivateKeyInfo
RSA_ReadPublicKey
RSA_SaveEncPrivateKey
RSA_SavePrivateKeyInfo
RSA_SavePublicKey
RSA_ToXMLString
TDEA_B64Mode
TDEA_BytesMode
TDEA_File
TDEA_HexMode
WIPE_Data
WIPE_File
X509_CertExpiresOn
X509_CertIssuedOn
X509_CertIssuerName
X509_CertIsValidNow
X509_CertRequest
X509_CertSerialNumber
X509_CertSubjectName
X509_CertThumb
X509_CheckCertInCRL
X509_GetCertFromP7Chain
X509_GetCertFromPFX
X509_HashIssuerAndSN
X509_KeyUsageFlags
X509_MakeCert
X509_MakeCertSelf
X509_MakeCRL
X509_QueryCert
X509_ReadStringFromFile
X509_SaveFileFromString
X509_TextDump
X509_ValidatePath
X509_VerifyCert
.NET Classes and Methods
Cross-reference between Functions and .NET Methods
.NET Help File
Summary of .NET Classes
Cipher Class
Cms Class
Cnv Class
General Class
Hash Class
Hmac Class
Ocsp Class
Pem Class
Pfx Class
Pwd Class
Rng Class
Rsa Class
Tdea Class
Wipe Class
X509 Class
List of .Net Methods
Cipher.Decrypt Method (Byte, Byte, Byte, CipherAlgorithm, Mode)
Cipher.Decrypt Method (String, String, String, CipherAlgorithm, Mode)
Cipher.Encrypt Method (Byte, Byte, Byte, CipherAlgorithm, Mode)
Cipher.Encrypt Method (String, String, String, CipherAlgorithm, Mode)
Cipher.FileDecrypt Method (String, String, Byte, Byte, CipherAlgorithm, Mode)
Cipher.FileDecrypt Method (String, String, String, String, CipherAlgorithm, Mode)
Cipher.FileEncrypt Method (String, String, Byte, Byte, CipherAlgorithm, Mode)
Cipher.FileEncrypt Method (String, String, String, String, CipherAlgorithm, Mode)
Cipher.KeyUnwrap Method
Cipher.KeyWrap Method
Cipher.Pad Method (Byte, CipherAlgorithm)
Cipher.Pad Method (String, CipherAlgorithm)
Cipher.Unpad Method (Byte, CipherAlgorithm)
Cipher.Unpad Method (String, CipherAlgorithm)
Cms.GetSigDataDigest Method
Cms.GetSigHashAlgorithm Method
Cms.MakeDetachedSig Method
Cms.MakeEnvData Method (String, String, String, CipherAlgorithm, Cms.KeyEncrAlgorithm, HashAlgorithm, Cms.EnvDataOptions)
Cms.MakeEnvDataFromString Method (String, String, String, CipherAlgorithm, Cms.KeyEncrAlgorithm, HashAlgorithm, Cms.EnvDataOptions)
Cms.MakeEnvDataFromString Method (String, String, String, Cms.Options)
Cms.MakeEnvData Method (String, String, String, Cms.Options)
Cms.MakeSigData Method
Cms.MakeSigDataFromSigValue Method
Cms.MakeSigDataFromString Method
Cms.QueryEnvData Method
Cms.QuerySigData Method
Cms.ReadEnvDataToFile Method
Cms.ReadEnvDataToString Method
Cms.ReadSigDataToFile Method
Cms.ReadSigDataToString Method
Cms.VerifySigData Method
Cnv.Base64Filter Method
Cnv.Base64FromHex Method
Cnv.ByteEncoding Method
Cnv.CheckUTF8 Method (Byte)
Cnv.CheckUTF8 Method (String)
Cnv.FromBase64 Method
Cnv.FromHex Method
Cnv.HexFilter Method
Cnv.HexFromBase64 Method
Cnv.StringFromBase64 Method
Cnv.StringFromHex Method
Cnv.ToBase64 Method (Byte)
Cnv.ToBase64 Method (String)
Cnv.ToHex Method
General.CompileTime Method
General.ErrorCode Method
General.ErrorLookup Method
General.IsWin64 Method
General.LastError Method
General.LicenceType Method
General.ModuleName Method
General.Platform Method
General.PowerUpTests Method
General.Version Method
Hash.BytesFromBytes Method
Hash.BytesFromFile Method
Hash.HexFromBytes Method
Hash.HexFromFile Method
Hash.HexFromHex Method
Hash.HexFromString Method
Hash.HexFromTextFile Method
Hmac.BytesFromBytes Method
Hmac.HexFromBytes Method
Hmac.HexFromHex Method
Ocsp.MakeRequest Method
Ocsp.ReadResponse Method
Pem.FileFromBinFile Method
Pem.FileToBinFile Method
Pfx.MakeFile Method
Pfx.SignatureIsValid Method
Pwd.Prompt Method (Int32, String)
Pwd.Prompt Method (Int32, String, String)
Rng.Bytes Method (Int32)
Rng.BytesWithPrompt Method (Int32)
Rng.BytesWithPrompt Method (Int32, String, Rng.Strength)
Rng.Bytes Method (Int32, Byte)
Rng.Bytes Method (Int32, String)
Rng.Initialize Method
Rng.MakeSeedFile Method
Rng.Number Method
Rng.Octet Method
Rng.Test Method
Rng.UpdateSeedFile Method
Rsa.CheckKey Method (String)
Rsa.CheckKey Method (StringBuilder)
Rsa.DecodeDigestForSignature Method (Byte)
Rsa.DecodeDigestForSignature Method (Byte, Boolean)
Rsa.DecodeMsg Method
Rsa.DecodeMsgForEncryption Method
Rsa.DecodeMsgIso9796 Method
Rsa.EncodeDigestForSignature Method
Rsa.EncodeMsg Method
Rsa.EncodeMsgForEncryption Method
Rsa.EncodeMsgForSignature Method
Rsa.EncodeMsgIso9796 Method
Rsa.FromXMLString Method
Rsa.GetPrivateKeyFromPFX Method
Rsa.GetPublicKeyFromCert Method
Rsa.KeyBits Method (String)
Rsa.KeyBits Method (StringBuilder)
Rsa.KeyBytes Method (String)
Rsa.KeyBytes Method (StringBuilder)
Rsa.KeyHashCode Method (String)
Rsa.KeyHashCode Method (StringBuilder)
Rsa.KeyMatch Method (String, String)
Rsa.KeyMatch Method (StringBuilder, StringBuilder)
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, CipherAlgorithm, HashAlgorithm, Rsa.Format, Boolean)
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, Rsa.PbeOptions, Boolean)
Rsa.MakeKeys Method (String, String, Int32, Rsa.PublicExponent, Int32, String, Rsa.PbeOptions, Boolean, Byte)
Rsa.RawPrivate Method (Byte, String)
Rsa.RawPrivate Method (Byte, String, Int32)
Rsa.RawPublic Method (Byte, String)
Rsa.RawPublic Method (Byte, String, Int32)
Rsa.ReadEncPrivateKey Method
Rsa.ReadPrivateKeyInfo Method
Rsa.ReadPublicKey Method
Rsa.SaveEncPrivateKey Method (String, String, Int32, String, CipherAlgorithm, HashAlgorithm, Rsa.Format)
Rsa.SaveEncPrivateKey Method (String, String, Int32, String, Rsa.PbeOptions, Rsa.Format)
Rsa.SavePrivateKeyInfo Method
Rsa.SavePublicKey Method
Rsa.ToXMLString Method
Tdea.Decrypt Method (Byte, Byte, Mode, Byte)
Tdea.Decrypt Method (String, String, Mode, String)
Tdea.Decrypt Method (String, String, Mode, String, EncodingBase)
Tdea.Encrypt Method (Byte, Byte, Mode, Byte)
Tdea.Encrypt Method (String, String, Mode, String)
Tdea.Encrypt Method (String, String, Mode, String, EncodingBase)
Tdea.FileDecrypt Method (String, String, Byte, Mode, Byte)
Tdea.FileDecrypt Method (String, String, String, Mode, String)
Tdea.FileEncrypt Method (String, String, Byte, Mode, Byte)
Tdea.FileEncrypt Method (String, String, String, Mode, String)
Wipe.Data Method
Wipe.File Method
Wipe.String Method
X509.CertExpiresOn Method
X509.CertIsValidNow Method
X509.CertIssuedOn Method
X509.CertIssuerName Method
X509.CertRequest Method
X509.CertSerialNumber Method
X509.CertSubjectName Method
X509.CertThumb Method
X509.CheckCertInCRL Method
X509.GetCertFromP7Chain Method
X509.GetCertFromPFX Method
X509.HashIssuerAndSN Method
X509.KeyUsageFlags Method
X509.MakeCRL Method
X509.MakeCert Method
X509.MakeCertSelf Method
X509.QueryCert Method (String, String)
X509.QueryCert Method (String, String, X509.Options)
X509.ReadStringFromFile Method
X509.SaveFileFromString Method
X509.TextDump Method
X509.ValidatePath Method (String)
X509.ValidatePath Method (String, String, Boolean)
X509.VerifyCert Method
Example code in VB.NET (VB2005/8/x)
Example: Cipher.Decrypt
Example: Cipher.FileDecrypt
Example: Cipher.Decrypt
Example: Cipher.KeyWrap
Example: Cipher.KeyUnwrap
Example: Cms.GetSigDataDigest
Example: Cms.GetSigDataDigest
Example: Cms.MakeDetachedSig
Example: Cms.MakeEnvData
Example: Cms.MakeEnvData
Example: Cms.KeyEncrAlgorithm
Example: Cms.MakeEnvDataFromString
Example: Cms.MakeSigData
Example: Cms.MakeSigData
Example: Cms.MakeSigDataFromSigValue
Example: Cms.ReadEnvDataToFile
Example: Cms.QueryEnvData
Example: Cms.ReadSigDataToFile
Example: Cms.ReadSigDataToString
Example: Cms.VerifySigData
Example: Cnv.ByteEncoding
Example: Cnv.CheckUTF8
Example: Hash.BytesFromBytes
Example: Hash.BytesFromFile
Example: Hash.HexFromBytes
Example: Hash.HexFromString
Example: Hash.HexFromFile
Example: Hash.HexFromHex
Example: Hmac.BytesFromBytes
Example: Hmac.HexFromBytes
Example: Hmac.HexFromHex
Example: Ocsp.MakeRequest
Example: Ocsp.ReadResponse
Example: Pem.FileFromBinFile
Example: Pem.FileToBinFile
Example: Pfx.MakeFile
Example: Pfx.MakeFile
Example: General.CompileTime
Example: General.ErrorLookup
Example: General.LicenceType
Example: General.ModuleName
Example: General.PowerUpTests
Example: General.Version
Example: Pwd.Prompt
Example: Rng.Bytes
Example: Rng.BytesWithPrompt
Example: Rng.Bytes
Example: Rng.Number
Example: Rng.Test
Example: Rsa.DecodeDigestForSignature
Example: Rsa.DecodeMsgForEncryption
Example: Rsa.CheckKey
Example: Rsa.CheckKey
Example: Rsa.GetPublicKeyFromCert
Example: Rsa.GetPublicKeyFromCert
Example: Rsa.MakeKeys
Example: Rsa.KeyBits
Example: Rsa.GetPublicKeyFromCert
Example: Rsa.KeyHashCode
Example: Rsa.KeyBits
Example: Rsa.Format
Example: Rsa.KeyBits
Example: Tdea.Decrypt
Example: Tdea.Decrypt
Example: Tdea.FileDecrypt
Example: Tdea.Decrypt
Example: Wipe.File
Example: X509.CertExpiresOn
Example: X509.CertIsValidNow
Example: X509.CertRequest
Example: X509.CertRequest
Example: X509.CertSerialNumber
Example: X509.CertIssuerName
Example: X509.CertThumb
Example: X509.CheckCertInCRL
Example: X509.GetCertFromP7Chain
Example: X509.HashIssuerAndSN
Example: X509.KeyUsageFlags
Example: X509.MakeCert
Example: X509.KeyUsageOptions
Example: X509.KeyUsageOptions
Example: X509.MakeCRL
Example: X509.TextDump
Example: X509.ValidatePath
Example: X509.VerifyCert
Error Handling and Error Codes
Acknowledgements
Primary References
Bibliography
Index
Revision History