SECUTECH SOLUTIONS PTY LTD UNIMATETOKEN ユーザーズマニュアル

ページ / 78
 
 
 
 
 
 
 
 
71 of 72 
 
2. Generate a key  
CryptGenKey  
3. Data Encryption  
CryptEncrypt  
4. Data Decryption  
CryptDecrypt  
 
Container Sample  
The sample demonstrates how  to enumerate,  add  and delete  containers  with int 
kcsTest(ULONG ulActive) function.  
 For enumerating a container  
STEPS  
FUNCTION   
1. Acquire a "VERIFYCONTEXT" handle  
CryptAcquireContext  
2. Enumerate the key containers  
CryptGetProvParam  
3. Acquire a handle to the key container found  
CryptAcquireContext  
4. Try to get a handle to the key pair  
CryptGetUserKey  
5. Get key permissions  
CryptGetKeyParam  
6. Display key permissions  
  
 
For adding a container  
STEPS   
FUNCTION   
1. Check whether the container already  
exists   
CryptAcquireContext  
2. If not, create a container  
CryptAcquireContext  
 
For deleting a container  
STEPS   
FUNCTION   
1. Check whether the container already  
CryptAcquireContext