Skip navigation links
JNA API 4.4.0
com.sun.jna.platform.win32

Interface Crypt32

    • Field Detail

      • INSTANCE

        static final Crypt32 INSTANCE
    • Method Detail

      • CryptProtectData

        boolean CryptProtectData(WinCrypt.DATA_BLOB pDataIn,
                                 String szDataDescr,
                                 WinCrypt.DATA_BLOB pOptionalEntropy,
                                 Pointer pvReserved,
                                 WinCrypt.CRYPTPROTECT_PROMPTSTRUCT pPromptStruct,
                                 int dwFlags,
                                 WinCrypt.DATA_BLOB pDataOut)
        The CryptProtectData function performs encryption on the data in a DATA_BLOB structure. Typically, only a user with the same logon credential as the encrypter can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer.
        Parameters:
        pDataIn - Pointer to a DATA_BLOB structure that contains the plaintext to be encrypted.
        szDataDescr - String with a readable description of the data to be encrypted. This description string is included with the encrypted data. This parameter is optional and can be set to NULL, except on Windows 2000.
        pOptionalEntropy - Pointer to a DATA_BLOB structure that contains a password or other additional entropy used to encrypt the data. The DATA_BLOB structure used in the encryption phase must also be used in the decryption phase. This parameter can be set to NULL for no additional entropy.
        pvReserved - Reserved for future use and must be set to NULL.
        pPromptStruct - Pointer to a CRYPTPROTECT_PROMPTSTRUCT structure that provides information about where and when prompts are to be displayed and what the content of those prompts should be. This parameter can be set to NULL in both the encryption and decryption phases.
        dwFlags - One of CRYPTPROTECT_LOCAL_MACHINE, CRYPTPROTECT_UI_FORBIDDEN, CRYPTPROTECT_AUDIT, CRYPTPROTECT_VERIFY_PROTECTION.
        pDataOut - Pointer to a DATA_BLOB structure that receives the encrypted data. When you have finished using the DATA_BLOB structure, free its pbData member by calling the LocalFree function.
        Returns:
        If the function succeeds, the function returns TRUE. If the function fails, it returns FALSE. For extended error information, call GetLastError.
      • CryptUnprotectData

        boolean CryptUnprotectData(WinCrypt.DATA_BLOB pDataIn,
                                   PointerByReference szDataDescr,
                                   WinCrypt.DATA_BLOB pOptionalEntropy,
                                   Pointer pvReserved,
                                   WinCrypt.CRYPTPROTECT_PROMPTSTRUCT pPromptStruct,
                                   int dwFlags,
                                   WinCrypt.DATA_BLOB pDataOut)
        The CryptUnprotectData function decrypts and does an integrity check of the data in a DATA_BLOB structure. Usually, only a user with the same logon credentials as the encrypter can decrypt the data. In addition, the encryption and decryption must be done on the same computer.
        Parameters:
        pDataIn - Pointer to a DATA_BLOB structure that holds the encrypted data. The DATA_BLOB structure's cbData member holds the length of the pbData member's byte string that contains the text to be encrypted.
        szDataDescr - Pointer to a string-readable description of the encrypted data included with the encrypted data. This parameter can be set to NULL. When you have finished using ppszDataDescr, free it by calling the LocalFree function.
        pOptionalEntropy - Pointer to a DATA_BLOB structure that contains a password or other additional entropy used when the data was encrypted. This parameter can be set to NULL; however, if an optional entropy DATA_BLOB structure was used in the encryption phase, that same DATA_BLOB structure must be used for the decryption phase.
        pvReserved - Reserved for future use; must be set to NULL.
        pPromptStruct - Pointer to a CRYPTPROTECT_PROMPTSTRUCT structure that provides information about where and when prompts are to be displayed and what the content of those prompts should be. This parameter can be set to NULL.
        dwFlags - DWORD value that specifies options for this function. This parameter can be zero, in which case no option is set, or CRYPTPROTECT_UI_FORBIDDEN.
        pDataOut - Pointer to a DATA_BLOB structure where the function stores the decrypted data. When you have finished using the DATA_BLOB structure, free its pbData member by calling the LocalFree function.
        Returns:
        If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE.
      • CertAddEncodedCertificateToSystemStore

        boolean CertAddEncodedCertificateToSystemStore(String szCertStoreName,
                                                       Pointer pbCertEncoded,
                                                       int cbCertEncoded)
        The CertAddEncodedCertificateToSystemStore function opens the specified system store and adds the encoded certificate to it.
        Parameters:
        szCertStoreName - A null-terminated string that contains the name of the system store for the encoded certificate.
        pbCertEncoded - A pointer to a buffer that contains the encoded certificate to add.
        cbCertEncoded - The size, in bytes, of the pbCertEncoded buffer.
        Returns:
        If the function succeeds, the return value is TRUE.
        If the function fails, the return value is FALSE.
        CertAddEncodedCertificateToSystemStore depends on the functions listed in the following remarks for error handling.
        Refer to those function topics for their respective error handling behaviors.
        For extended error information, call GetLastError.
        See Also:
        MSDN
JNA API 4.4.0

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.