.NET Components
Chilkat .NET Components for Email, Zip Compression, Encryption, XML, S/MIME, and Character Encoding Conversion

BACK

Chilkat::Crypt Class

An encryption class providing: (1) Easy-to-use RSA public-key encryption and decryption. (2) Digital signature creation and validation. (3) 128, 192, and 256-bit AES Rijndael Encryption and Decryption. (4) 128, 192, and 256-bit Blowfish and Twofish Encryption and Decryption. (5) SHA-1, Digest MD5 and MD2 Hashing. (6) Base64 and Quoted-Printable conversion. (7) Supports any Cryptographic Service Provider, including Smart Card vendors. (8) Integrated Zip-and-Encrypt functionality such that Chilkat Zip.NET does not need to be purchased. (9) Licensed by the US Government for export under License Exception ENC Sections 740.17 (A) and (B)(3). Export Classification: 5D002

Base Classes: Object
  Properties Description  
    EncryptCertSubject An easy way of specifying the certificate to be used for RSA public-key encryption. This string should match one of the subject fields in a certificate, such as the common name (CN), email address (E), organization (O), organizational unit (OU), locality (L), state (ST), or country (C). In most cases, it is easiest to identify the certificate uniquely by specifying the email address. Chilkat Crypt.NET will automatically attempt to locate and use a certificate mathing this property's value. If a certificate cannot be found, the encryption will fail. Otherwise, the full certificate subject will be saved in LastCertSubject after a RSA public-key encryption operation.

 
    IV Initialization vector for the Rijndael and Twofish symmetric encryption algorithms. This byte array should be exactly 16-bytes long, and if specified, the same IV needs to be used in decrypting as that which was used to encrypt the data. It is not necessary to set an IV to use Rijndael or Twofish.

 
    KeyLength The length of the symmetric algorithm encryption key, in bits. The default is 128. The key length must be 128, 192, and 256 bits. Symmetric algorithms include Rijndael (AES), Twofish, and Blowfish.

 
    LastAlgorithm Contains the name of the last encryption algorithm used.

 
    LastCertSubject Contains the full subject of the last certificate used for RSA public-key encryption or digital signature creation.

 
    LastError An XML-formatted string containing error information, if any, of the last method call.

 
    SecretKey The symmetric algorithm secret key. To decrypt successfully, the secret key and key length must match the values used during encryption.

 
    SigningCertSubject An easy way of specifying the certificate to be used for digital signature creation. This string should match one of the subject fields in a certificate, such as the common name (CN), email address (E), organization (O), organizational unit (OU), locality (L), state (ST), or country (C). In most cases, it is easiest to identify the certificate uniquely by specifying the email address. Chilkat Crypt.NET will automatically attempt to locate and use a certificate mathing this property's value. If a certificate cannot be found, the signing will fail. Otherwise, the full certificate subject will be saved in LastCertSubject after a digital signature is created.

 
    UseStandardSearchCertStores Tells Chilkat Crypt.NET to search the following certificate stores in this order: (1) Local Machine Certificate Store: This exists on every MS Windows system and is located in the registry. These certificates are shared among all users of the system. (2) Chilkat Email.NET Certificate Store: This is the certificate store used with Chilkat Email.NET, and is located in the registry under HKEY_LOCAL_MACHINE:Software/Chilkat/SystemCertificates (3) Microsoft AddressBook: This is the certificate store used by Microsoft Outlook and is located in the registry under HKEY_CURRENT_USER:Software/Microsoft/SystemCertificates/AddressBook. (4) Current User Certificate Store: This exists on every MS Windows system and is located in the registry. Each user has his own private certificate store.

 
    Version The version of the component, such as "2.0.0".

 
  Methods Description  
    AddSearchCertStore Add a certificate store to the search path for locating a digital certificate.

 
    CreateSignature Creates a detached digital signature for a block of memory data. Returns the digital signature as a byte array.

 
    CreateSignatureStr Creates a detached digital signature for a string. Returns the digital signature as a byte array.

 
    DecodeBase64 Decode a Base64 string and return the original data as a byte array.

 
    DecodeQuotedPrintable Decodes a string encoded in the quoted-printable format. Returns the original data as a byte array.

 
    DecryptAndUnzip In a single operation, decrypts and unzips a block of memory that was previously zipped and encrypted using the ZipAndEncrypt method. A NULL is returned on failure.

 
    DecryptAndUnzipStr In a single operation, decrypts and unzips a block of memory that was previously zipped and encrypted using the ZipAndEncryptStr method. The result is returned as a string. A NULL is returned on failure.

 
    Decrypt Decrypt a block of memory data. If the decryption failed, a NULL value is returned.

 
    DecryptStr Decrypt a block of memory data and return a string. If the decryption failed, a NULL value is returned.

 
    DigestMD2 Create an MD2 Digest of a block of memory data.

 
    DigestMD2Str Create an MD2 Digest of a string.

 
    DigestMD5 Create an MD5 Digest of a block of memory data.

 
    DigestMD5Str Create an MD5 Digest of a string.

 
    EncodeBase64 Base64 encode a block of memory data.

 
    EncodeBase64Str Base64 encode a string in memory.

 
    EncodeQuotedPrintable Quoted-printable encode a block of memory data.

 
    EncodeQuotedPrintableStr Quoted-printable encode a string in memory.

 
    Encrypt Encrypt a block of memory data. Returns the encrypted data as a byte array.

 
    EncryptStr Encrypt a string in memory. Returns the encrypted data as a byte array.

 
    HashSHA1 Create a SHA-1 hash of a block of memory data

 
    HashSHA1Str Create a SHA-1 hash of a string in memory

 
    IsUnlocked Returns True if the class is already unlocked, otherwise returns False.

 
    SaveLastError Saves the error log to an XML file

 
    SetAlgorithmBlowfish Sets the encryption algorithm to Blowfish

 
    SetAlgorithmRijndael Sets the encryption algorithm to Rijndael, which is the AES standard encryption algorithm

 
    SetAlgorithmRSA Sets the encryption algorithm to to RSA public-key encryption.

 
    SetAlgorithmTwofish Sets the encryption algorithm to Twofish

 
    SetCSP Sets the cryptographic service provider (CSP) to be used for public-key encryption. In most cases this is not called, but it can be used to control the encryption algorithm, key length, hashing algorithm, etc., or to use a CSP from a 3rd party, such as a smart card vendor.

 
    SetEncryptCertificate Sets the certificate that will be used for public-key RSA encryption.

 
    SetSecretKeyViaPassPhrase Generates a secret key from a pass-phrase. This method sets the SecretKey property indirectly.

 
    SetSigningCertificate Sets the certificate that will be used for digital signature creation.

 
    UnlockComponent Unlocks the component allowing for the full functionality to be used. Returns true if the unlock code is valid.

 
    VerifySignature Verify memory data against a digital signature. Returns True if the data was verified to be unaltered. Returns false if the data was altered, or if the signature could not be verified for other reasons.

 
    VerifySignatureStr Verify a string against a digital signature. Returns True if the string was verified to be unaltered. Returns false if the string was altered, or if the signature could not be verified for other reasons.

 
    ZipAndEncrypt First Zip compresses a block of memory data and then encrypts it. The memory data can be restored by calling DecryptAndUnzip.

 
    ZipAndEncryptStr First Zip compresses a string and then encrypts it. The string can be restored by calling DecryptAndUnzipStr.

 

Copyright 2002, Chilkat Software, Inc. All Rights Reserved.