/* Licensed to Stichting The Commons Conservancy (TCC) under one or more * contributor license agreements. See the AUTHORS file distributed with * this work for additional information regarding copyright ownership. * TCC licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CRYPTO_H #define CRYPTO_H #include "signtext.h" #pragma comment(lib, "crypt32.lib") #pragma comment(lib, "ncrypt.lib") #ifdef __cplusplus extern "C" { #endif void crypto_start(SignTextData* signtext); int crypto_certificate_is_hardware(SignTextCertificate* certificate); int crypto_certificate_is_removable(SignTextCertificate* certificate); int crypto_certificate_find(SignTextCertificate* c1, SignTextCertificate* c2); int crypto_certificate_compare(SignTextCertificate* c1, SignTextCertificate* c2); void crypto_sign(SignTextInstance* instance); /* From cardmod.h */ typedef DWORD PIN_SET, * PPIN_SET; typedef enum { AuthenticationPin, // Authentication PIN DigitalSignaturePin, // Digital Signature PIN EncryptionPin, // Encryption PIN NonRepudiationPin, // Non Repudiation PIN AdministratorPin, // Administrator PIN PrimaryCardPin, // Primary Card PIN UnblockOnlyPin, // Unblock only PIN (PUK) } SECRET_PURPOSE; typedef enum { PinCacheNormal = 0, PinCacheTimed, PinCacheNone, PinCacheAlwaysPrompt } PIN_CACHE_POLICY_TYPE; typedef struct _PIN_CACHE_POLICY { DWORD dwVersion; PIN_CACHE_POLICY_TYPE PinCachePolicyType; DWORD dwPinCachePolicyInfo; } PIN_CACHE_POLICY, * PPIN_CACHE_POLICY; typedef struct _PIN_INFO { DWORD dwVersion; SECRET_TYPE PinType; SECRET_PURPOSE PinPurpose; PIN_SET dwChangePermission; PIN_SET dwUnblockPermission; PIN_CACHE_POLICY PinCachePolicy; DWORD dwFlags; } PIN_INFO, * PPIN_INFO; #if 0 #endif #ifdef __cplusplus } #endif #endif