|
ChilkatCSP
Reference
Docs:
Certificate
Crypt
XML
Mail
MHT
S/MIME
Zip
XMsg
SSL
RTC
Charset
CkStringArray
CkData
ChilkatCSP
This
component is part of the Chilkat Util Dll.
The ChilkatCSP
object is used to explore the Cryptographic Service Providers
on your machine, and to specify the CSP, encryption, and hash
algorithms to use for encryption and digital signature creation.
Example
and Screenshot
The ChilkatCSP
object is the standard way to select the CSP, key container, and
encryption/hash algorithms for all Chilkat components that provide
encryption and digital signature capabilities.
A Visual
Basic example of using ChilkatCSP with a ChilkatEmail object is
shown below:
Dim csp as ChilkatCSP
Set csp = New ChilkatCSP
' Properties are initialized to defaults, so only set what needs to be changed.
csp.ProviderName = "Microsoft Enhanced Cryptographic Provider v1.0"
csp.KeyContainerName = "My Container"
csp.SetEncryptionAlgorithm("3DES")
csp.SetHashAlgorithm("MD5")
Dim email as ChilkatEmail
Set email = new ChilkatEmail
email.SendEncrypted = 1
email.SetCSP csp
' When the email is sent, it will be encrypted using the MS Enhanced CSP
' and 3DES encryption will be used.
...
Allows for Smart
Card CSPs
This architecture will
allow any CSP to be used, including hardware-based smart-card
CSPs.
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 read/write
- 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.
-
- ProviderName
As String read/write
- 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".
-
- 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.
-
- 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.
- GetEncryptionNumBits(index
As Long) As Long
- Returns the key
length of the Nth encryption algorithm provided by the currently
selected CSP. Indexing begins at 0.
- GetHashAlgorithm(index
As Long) As String
- Returns the Nth
hash algorithm provided by the currently selected CSP. Indexing
begins at 0.
- 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 CkStringArray
containing the names of all the key containers in the current
CSP.
- GetServiceProviders()
As CkStringArray (Only avaliable on Windows
2000 and Windows XP)
- Returns a CkStringArray
containing the names of all Cryptographic Service Providers
on the computer.
- HasEncryptAlgorithm
(name As String, numBits As Long) As Long
- Returns 1 if the
currently selected CSP contains an encryption algorithm matching
the name and key length. Otherwise returns 0.
- HasHashAlgorithm
(name As String, numBits As Long) As Long
- Returns 1 if the
currently selected CSP contains a hash algorithm matching the
name and bit length. Otherwise returns 0.
- SetEncryptAlgorithm(name
As String) As Long
- Sets the currently
selected 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
- Sets the currently
selected encryption 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.
- SetProviderMicrosoftRsaAes()
- Sets the CSP to
the Microsoft Cryptographic RSA/AES Prototype Provider.
- SetProviderMicrosoftStrong()
- Sets the CSP to
the Strong Microsoft Cryptographic Provider.
-
To
view the Cryptographic Service Providers on your Windows 2000
or Windows XP computer, download the following Visual Basic
application and Win2K version of the ChilkatUtil control: Download
Win2K ChilkatUtil

-
-
-
-
-
-
|
Privacy
Statement. Copyright 2000-2012 Chilkat
Software, Inc. All rights reserved.
(Regarding the usage of the Android logo) Portions of this page are reproduced from work created and shared by Google
and used according to terms described in the Creative Commons
3.0 Attribution License.
Send feedback to support@chilkatsoft.com
Software components and libraries for Linux, MAC OS X, IOS (IPhone), Android™, Solaris, RHEL/CentOS Microsoft Windows 7, Vista, XP, 2000, 2003 Server, 2008 Server, and Windows 95/98/NT4.
|
|