ChilkatCsp ActiveX Reference (Visual Basic)
ChilkatCsp
* This is a freeware class/component/library.
Represents a cryptographic service provider for selecting encryption, hashing, and digital signing algorithms.
Properties
EncryptAlgorithm As String (read-only)
Returns the name of the currently selected encryption algorithm in the currently selected CSP.
EncryptAlgorithmID As Long (read-only)
Returns the ID of the currently selected encryption algorithm in the currently selected CSP.
EncryptNumBits As Long (read-only)
Returns the key-length of the currently selected encryption algorithm in the currently selected CSP.
HashAlgorithm As String (read-only)
Returns the name of the currently selected hash algorithm in the currently selected CSP.
HashAlgorithmID As Long (read-only)
Returns the ID of the currently selected hash algorithm in the currently selected CSP.
HashNumBits As Long (read-only)
Returns the bit length of the currently selected hash algorithm in the currently selected CSP.
KeyContainerName As String
The name of the currently selected key container within the currently selected CSP. The default is typically the name of the current logged-in user.
LastErrorHtml As String (read-only)
Error information in HTML format for the last method called.
LastErrorText As String (read-only)
Error information in plain-text format for the last method called.
LastErrorXml As String (read-only)
Error information in XML format for the last method called.
MachineKeyset As Long
To be documented soon...
NumEncryptAlgorithms As Long (read-only)
The number of encryption algorithms provided by the currently selected CSP.
NumHashAlgorithms As Long (read-only)
The number of hash algorithms provided by the currently selected CSP.
ProviderName As String
The currently selected CSP. To select another CSP, simply set this property to the name of the CSP, such as "Microsoft Enhanced Cryptographic Provider v1.0". If the CSP is not available on your machine, the property value will not change. The initial and default value for this property is "Microsoft Base Cryptographic Provider v1.0".
ProviderType As Long (read-only)
This is an integer representing the type of CSP. (Chilkat uses it for internal use.)
Methods
GetEncryptionAlgorithm(index As Long) As String
Returns the name of the Nth encryption algorithm provided by the currently selected CSP. Indexing begins at 0. Returns a null on failure
GetEncryptionNumBits(index As Long) As Long
Returns the key-length of the currently selected encryption algorithm in the currently selected CSP.
GetHashAlgorithm(index As Long) As String
Returns the name of the currently selected hash algorithm in the currently selected CSP. Returns a null on failure
GetHashNumBits(index As Long) As Long
Returns the bit length of the Nth hash algorithm provided by the currently selected CSP. Indexing begins at 0.
GetKeyContainerNames() As CkStringArray
Returns a string array containing the names of all the key containers in the current CSP.
HasEncryptAlgorithm(name As String, numBits As Long) As Long
Returns true if the currently selected CSP contains an encryption algorithm matching the name and key length. Otherwise returns false.
HasHashAlgorithm(name As String, numBits As Long) As Long
Returns true if the currently selected CSP contains a hash algorithm matching the name and bit length. Otherwise returns false.
Serialize() As String
To be documented soon...
SetEncryptAlgorithm(name As String) As Long
Selects an encryption algorithm. The return value is the key-length of the algorithm. If the algorithm is not available, the return value is 0. (There usually is not a need to explicitly select the key length, because the key length can be part of the name, such as "AES 128", or it is determined by the CSP. For example, the Microsoft Enhanced CSP will return a 128-bit key length for RC2, whereas the Base CSP will return a 40-bit key length.)
SetHashAlgorithm(name As String) As Long
Selects a hash algorithm. The return value is the bit-length of the algorithm. If the algorithm is not available, the return value is 0.
SetProviderMicrosoftBase()
Sets the CSP to the Base Microsoft Cryptographic Provider, which is the default.
SetProviderMicrosoftEnhanced()
Sets the CSP to the Enhanced Microsoft Cryptographic Provider.
SetProviderMicrosoftStrong()
Sets the CSP to the Strong Microsoft Cryptographic Provider.
|