Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- Provider: NCRYPT_PROV_HANDLE;
- Reader: PByte;
- ReaderSize: DWORD;
- MemorySize: DWORD;
- begin
- // Get a handle to the smartcard reader specific provider
- Status := NCryptOpenStorageProvider(@Provider
- ,'SafeSign Standard RSA and AES Cryptographic Service Provider'
- ,0); // returns ERROR_SUCCESS
- // Convert the name of the reader to a PByte
- UnicodeStringToBinary('Giesecke & Devrient GmbH StarSign CUT 0',Reader,ReaderSize);
- // Inform the name of the reader to the CNG
- Status := NCryptSetProperty(Provider
- ,NCRYPT_READER_PROPERTY
- ,Reader
- ,ReaderSize
- ,0); // returns ERROR_SUCCESS
- MemorySize := SizeOf(HCERTSTORE);
- // Try to get the size needed to a variable of type HCERTSTORE.
- // This is the first step before get the certificate store
- Status := NCryptGetProperty(Provider
- ,NCRYPT_USER_CERTSTORE_PROPERTY
- ,nil
- ,0
- ,@MemorySize
- ,0); //Returns 0x80090029 (NTE_NOT_SUPPORTED)
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement