CkCsp Java Programming Reference Documentation
CkCsp
* This is a freeware class/component/library.
Represents a cryptographic service provider for selecting encryption, hashing, and digital signing algorithms.
Properties
// alg is a CkString object (output) get_EncryptAlgorithm( alg )
Returns the name of the currently selected encryption algorithm in the currently selected CSP.
// Returns an integer value get_EncryptAlgorithmID( )
Returns the ID of the currently selected encryption algorithm in the currently selected CSP.
// Returns an integer value get_EncryptNumBits( )
Returns the key-length of the currently selected encryption algorithm in the currently selected CSP.
// alg is a CkString object (output) get_HashAlgorithm( alg )
Returns the name of the currently selected hash algorithm in the currently selected CSP.
// Returns an integer value get_HashAlgorithmID( )
Returns the ID of the currently selected hash algorithm in the currently selected CSP.
// Returns an integer value get_HashNumBits( )
Returns the bit length of the currently selected hash algorithm in the currently selected CSP.
// name is a CkString object (output) get_KeyContainerName( name )
// name is a string (input) put_KeyContainerName( name )
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.
// str is a CkString object (output) LastErrorHtml( str )
Error information in HTML format for the last method called.
// str is a CkString object (output) LastErrorText( str )
Error information in plain-text format for the last method called.
// str is a CkString object (output) LastErrorXml( str )
Error information in XML format for the last method called.
// Returns a boolean value get_MachineKeyset( )
// val is a boolean (input) put_MachineKeyset( val )
To be documented soon...
// Returns an integer value get_NumEncryptAlgorithms( )
The number of encryption algorithms provided by the currently selected CSP.
// Returns an integer value get_NumHashAlgorithms( )
The number of hash algorithms provided by the currently selected CSP.
// Returns an integer value get_NumKeyContainers( )
The number of key containers provided by the currently selected CSP.
// Returns an integer value get_NumKeyExchangeAlgorithms( )
The number of key exchange algorithms provided by the currently selected CSP.
// Returns an integer value get_NumSignatureAlgorithms( )
The number of signature algorithms provided by the currently selected CSP.
// name is a CkString object (output) get_ProviderName( name )
// name is a string (input) put_ProviderName( name )
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".
// Returns an integer value get_ProviderType( )
This is an integer representing the type of CSP. (Chilkat uses it for internal use.)
Methods
// index is an integer (input) // name is a CkString object (output) // Returns a boolean value GetEncryptionAlgorithm( index, name )
Returns the name of the Nth encryption algorithm provided by the currently selected CSP. Indexing begins at 0. Returns true for success, false for failure.
// index is an integer (input) // Returns an integer value GetEncryptionNumBits( index )
Returns the key-length of the currently selected encryption algorithm in the currently selected CSP.
// index is an integer (input) // name is a CkString object (output) // Returns a boolean value GetHashAlgorithm( index, name )
Returns the name of the currently selected hash algorithm in the currently selected CSP. Returns true for success, false for failure.
// index is an integer (input) // Returns an integer value GetHashNumBits( index )
Returns the bit length of the Nth hash algorithm provided by the currently selected CSP. Indexing begins at 0.
// index is an integer (input) // name is a CkString object (output) // Returns a boolean value GetKeyContainerName( index, name )
Returns the Nth key container name in the currently selected CSP. Indexing begins at 0. Returns true for success, false for failure.
GetKeyContainerNames( )
Returns a string array containing the names of all the key containers in the current CSP.
// index is an integer (input) // name is a CkString object (output) // Returns a boolean value GetKeyExchangeAlgorithm( index, name )
Returns the Nth key exchange algorithm provided by the currently selected CSP. Indexing begins at 0. Returns true for success, false for failure.
// index is an integer (input) // Returns an integer value GetKeyExchangeNumBits( index )
Returns the bit length of the Nth key exchange algorithm provided by the currently selected CSP. Indexing begins at 0.
// index is an integer (input) // name is a CkString object (output) // Returns a boolean value GetSignatureAlgorithm( index, name )
Returns the name of the Nth signature algorithm provided by the currently selected CSP. Indexing begins at 0. Returns true for success, false for failure.
// index is an integer (input) // Returns an integer value GetSignatureNumBits( index )
Returns the bit length of the Nth signature algorithm provided by the currently selected CSP. Indexing begins at 0.
// name is a string (input) // numBits is an integer (input) // Returns a boolean value HasEncryptAlgorithm( name, numBits )
Returns true if the currently selected CSP contains an encryption algorithm matching the name and key length. Otherwise returns false.
// name is a string (input) // numBits is an integer (input) // Returns a boolean value HasHashAlgorithm( name, numBits )
Returns true if the currently selected CSP contains a hash algorithm matching the name and bit length. Otherwise returns false.
// filename is a string (input) // Returns a boolean value SaveLastError( filename )
Saves the last error information to an XML formatted file.
// name is a string (input) // Returns an integer value SetEncryptAlgorithm( name )
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.)
// name is a string (input) // Returns an integer value SetHashAlgorithm( name )
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.
// Returns a boolean value SetProviderMicrosoftBase( )
Sets the CSP to the Base Microsoft Cryptographic Provider, which is the default.
// Returns a boolean value SetProviderMicrosoftEnhanced( )
Sets the CSP to the Enhanced Microsoft Cryptographic Provider.
// Returns a boolean value SetProviderMicrosoftRsaAes( )
Sets the CSP to the Microsoft Cryptographic RSA/AES Prototype Provider.
// Returns a boolean value SetProviderMicrosoftStrong( )
Sets the CSP to the Strong Microsoft Cryptographic Provider.
// Returns a string encryptAlgorithm( )
Returns the name of the currently selected encryption algorithm in the currently selected CSP.
// index is an integer (input) // Returns a string getEncryptionAlgorithm( index )
Returns the name of the Nth encryption algorithm provided by the currently selected CSP. Indexing begins at 0.
// index is an integer (input) // Returns a string getHashAlgorithm( index )
Returns the name of the currently selected hash algorithm in the currently selected CSP.
// index is an integer (input) // Returns a string getKeyContainerName( index )
Returns the Nth key container name in the currently selected CSP. Indexing begins at 0.
// index is an integer (input) // Returns a string getKeyExchangeAlgorithm( index )
Returns the Nth key exchange algorithm provided by the currently selected CSP. Indexing begins at 0.
// index is an integer (input) // Returns a string getSignatureAlgorithm( index )
Returns the name of the Nth signature algorithm provided by the currently selected CSP. Indexing begins at 0.
// Returns a string hashAlgorithm( )
Returns the name of the currently selected hash algorithm in the currently selected CSP.
// Returns a string keyContainerName( )
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.
// Returns a string lastErrorHtml( )
Error information in HTML format for the last method called.
// Returns a string lastErrorText( )
Error information in plain-text format for the last method called.
// Returns a string lastErrorXml( )
Error information in XML format for the last method called.
// Returns a string providerName( )
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".
|