⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cryptlib.pas

📁 老外写的加密库cryptlib(版本3.1)
💻 PAS
📖 第 1 页 / 共 5 页
字号:
unit cryptlib;

interface

{****************************************************************************
*                                                                           *
*                     Cryptlib external API interface                       *
*                    Copyright Peter Gutmann 1997-2003                      *
*                                                                           *
*        adapted for Delphi Version 5 (32 bit) and Kylix Version 3          *
*                              by W. Gothier                                *
****************************************************************************}

{------------------------------------------------------------------------------

 This file has been created automatically by a perl script from the file:

 "cryptlib.h" dated Fri Dec 12 02:22:00 2003, filesize = 80561.

 Please check twice that the file matches the version of cryptlib.h
 in your cryptlib source! If this is not the right version, try to download an
 update from "http://www.sogot.de/cryptlib/". If the filesize or file creation
 date do not match, then please do not complain about problems.

 Published by W. Gothier,
 mailto: cryptlib@gothier.net if you find errors in this file.

-------------------------------------------------------------------------------}

{$A+}    {Set Alignment on}
{$F+}    {Force function calls to FAR}
{$Z+}    {Force all enumeration values to Integer size}

const
  {$IFDEF WIN32}
  cryptlibname = 'CL32.DLL'; { dynamic linkname for Windows (Delphi) }
  {$ELSE}
  cryptlibname = 'libcl.so'; { library name for Unix/Linux  (Kylix) }
                 { symbolic link should be used for libcl.so -> libcl.so.3.x.y }
  {$ENDIF}

  {****************************************************************************
  *                                                                           *
  *                           Algorithm and Object Types                      *
  *                                                                           *
  ****************************************************************************}

  {  Algorithm and mode types  }

type
  CRYPT_ALGO_TYPE = Integer;
const
  { Algorithms }
  { No encryption }
  CRYPT_ALGO_NONE                                      = 0;   { No encryption }

  { Conventional encryption }
  CRYPT_ALGO_DES                                       = 1;   { DES }
  CRYPT_ALGO_3DES                                      = 2;   { Triple DES }
  CRYPT_ALGO_IDEA                                      = 3;   { IDEA }
  CRYPT_ALGO_CAST                                      = 4;   { CAST-128 }
  CRYPT_ALGO_RC2                                       = 5;   { RC2 }
  CRYPT_ALGO_RC4                                       = 6;   { RC4 }
  CRYPT_ALGO_RC5                                       = 7;   { RC5 }
  CRYPT_ALGO_AES                                       = 8;   { AES }
  CRYPT_ALGO_BLOWFISH                                  = 9;   { Blowfish }
  CRYPT_ALGO_SKIPJACK                                  = 10;  { Skipjack }

  { Public-key encryption }
  CRYPT_ALGO_DH                                        = 100; { Diffie-Hellman }
  CRYPT_ALGO_RSA                                       = 101; { RSA }
  CRYPT_ALGO_DSA                                       = 102; { DSA }
  CRYPT_ALGO_ELGAMAL                                   = 103; { ElGamal }
  CRYPT_ALGO_KEA                                       = 104; { KEA }

  { Hash algorithms }
  CRYPT_ALGO_MD2                                       = 200; { MD2 }
  CRYPT_ALGO_MD4                                       = 201; { MD4 }
  CRYPT_ALGO_MD5                                       = 202; { MD5 }
  CRYPT_ALGO_SHA                                       = 203; { SHA/SHA1 }
  CRYPT_ALGO_RIPEMD160                                 = 204; { RIPE-MD 160 }

  { MAC's }
  CRYPT_ALGO_HMAC_MD5                                  = 300; { HMAC-MD5 }
  CRYPT_ALGO_HMAC_SHA                                  = 301; { HMAC-SHA }
  CRYPT_ALGO_HMAC_RIPEMD160                            = 302; { HMAC-RIPEMD-160 }

  { Vendors may want to use their own algorithms that aren't part of the
  general cryptlib suite.  The following values are for vendor-defined
  algorithms, and can be used just like the named algorithm types (it's
  up to the vendor to keep track of what _VENDOR1 actually corresponds
  to) }

  CRYPT_ALGO_LAST                                      = 303; { Last possible crypt algo value }

  { In order that we can scan through a range of algorithms with
  cryptQueryCapability(), we define the following boundary points for
  each algorithm class }
  CRYPT_ALGO_FIRST_CONVENTIONAL                        = 1;   { = CRYPT_ALGO_DES }
  CRYPT_ALGO_LAST_CONVENTIONAL                         = 99;
  CRYPT_ALGO_FIRST_PKC                                 = 100; { = CRYPT_ALGO_DH }
  CRYPT_ALGO_LAST_PKC                                  = 199;
  CRYPT_ALGO_FIRST_HASH                                = 200; { = CRYPT_ALGO_MD2 }
  CRYPT_ALGO_LAST_HASH                                 = 299;
  CRYPT_ALGO_FIRST_MAC                                 = 300; { = CRYPT_ALGO_HMAC_MD5 }
  CRYPT_ALGO_LAST_MAC                                  = 399; { End of mac algo.range }

type
  CRYPT_MODE_TYPE = (                                         {  Block cipher modes  }
    CRYPT_MODE_NONE,                                          {  No encryption mode  }
    CRYPT_MODE_ECB,                                           {  ECB  }
    CRYPT_MODE_CBC,                                           {  CBC  }
    CRYPT_MODE_CFB,                                           {  CFB  }
    CRYPT_MODE_OFB,                                           {  OFB  }
    CRYPT_MODE_LAST                                           {  Last possible crypt mode value  }

    );

  {  Keyset subtypes  }

  CRYPT_KEYSET_TYPE = (                                       {  Keyset types  }
    CRYPT_KEYSET_NONE,                                        {  No keyset type  }
    CRYPT_KEYSET_FILE,                                        {  Generic flat file keyset  }
    CRYPT_KEYSET_HTTP,                                        {  Web page containing cert/CRL  }
    CRYPT_KEYSET_LDAP,                                        {  LDAP directory service  }
    CRYPT_KEYSET_ODBC,                                        {  Generic ODBC interface  }
    CRYPT_KEYSET_DATABASE,                                    {  Generic RDBMS interface  }
    CRYPT_KEYSET_PLUGIN,                                      {  Generic database plugin  }
    CRYPT_KEYSET_ODBC_STORE,                                  {  ODBC certificate store  }
    CRYPT_KEYSET_DATABASE_STORE,                              {  Database certificate store  }
    CRYPT_KEYSET_PLUGIN_STORE,                                {  Database plugin certificate store  }
    CRYPT_KEYSET_LAST                                         {  Last possible keyset type  }

    );

  {  Device subtypes  }

  CRYPT_DEVICE_TYPE = (                                       {  Crypto device types  }
    CRYPT_DEVICE_NONE,                                        {  No crypto device  }
    CRYPT_DEVICE_FORTEZZA,                                    {  Fortezza card  }
    CRYPT_DEVICE_PKCS11,                                      {  PKCS #11 crypto token  }
    CRYPT_DEVICE_CRYPTOAPI,                                   {  Microsoft CryptoAPI  }
    CRYPT_DEVICE_LAST                                         {  Last possible crypto device type  }

    );

  {  Certificate subtypes  }

  CRYPT_CERTTYPE_TYPE = (                                     {  Certificate object types  }
    CRYPT_CERTTYPE_NONE,                                      {  No certificate type  }
    CRYPT_CERTTYPE_CERTIFICATE,                               {  Certificate  }
    CRYPT_CERTTYPE_ATTRIBUTE_CERT,                            {  Attribute certificate  }
    CRYPT_CERTTYPE_CERTCHAIN,                                 {  PKCS #7 certificate chain  }
    CRYPT_CERTTYPE_CERTREQUEST,                               {  PKCS #10 certification request  }
    CRYPT_CERTTYPE_REQUEST_CERT,                              {  CRMF certification request  }
    CRYPT_CERTTYPE_REQUEST_REVOCATION,                        {  CRMF revocation request  }
    CRYPT_CERTTYPE_CRL,                                       {  CRL  }
    CRYPT_CERTTYPE_CMS_ATTRIBUTES,                            {  CMS attributes  }
    CRYPT_CERTTYPE_RTCS_REQUEST,                              {  RTCS request  }
    CRYPT_CERTTYPE_RTCS_RESPONSE,                             {  RTCS response  }
    CRYPT_CERTTYPE_OCSP_REQUEST,                              {  OCSP request  }
    CRYPT_CERTTYPE_OCSP_RESPONSE,                             {  OCSP response  }
    CRYPT_CERTTYPE_PKIUSER,                                   {  PKI user information  }
    CRYPT_CERTTYPE_LAST                                       {  Last possible cert.type  }

    );

  {  Envelope/data format subtypes  }

  CRYPT_FORMAT_TYPE = (
    CRYPT_FORMAT_NONE,                                        {  No format type  }
    CRYPT_FORMAT_AUTO,                                        {  Deenv, auto-determine type  }
    CRYPT_FORMAT_CRYPTLIB,                                    {  cryptlib native format  }
    CRYPT_FORMAT_CMS,                                         {  PKCS #7 / CMS / S/MIME fmt.}
    CRYPT_FORMAT_SMIME,                                       {  As CMS with MSG-style behaviour  }
    CRYPT_FORMAT_PGP,                                         {  PGP format  }
    CRYPT_FORMAT_LAST                                         {  Last possible format type  }

    );

const
  CRYPT_FORMAT_PKCS7                                   : CRYPT_FORMAT_TYPE = CRYPT_FORMAT_CMS;

  {  Session subtypes  }

type
  CRYPT_SESSION_TYPE = (
    CRYPT_SESSION_NONE,                                       {  No session type  }
    CRYPT_SESSION_SSH,                                        {  SSH  }
    CRYPT_SESSION_SSH_SERVER,                                 {  SSH server  }
    CRYPT_SESSION_SSL,                                        {  SSL/TLS  }
    CRYPT_SESSION_SSL_SERVER,                                 {  SSL/TLS server  }
    CRYPT_SESSION_RTCS,                                       {  RTCS  }
    CRYPT_SESSION_RTCS_SERVER,                                {  RTCS server  }
    CRYPT_SESSION_OCSP,                                       {  OCSP  }
    CRYPT_SESSION_OCSP_SERVER,                                {  OCSP server  }
    CRYPT_SESSION_TSP,                                        {  TSP  }
    CRYPT_SESSION_TSP_SERVER,                                 {  TSP server  }
    CRYPT_SESSION_CMP,                                        {  CMP  }
    CRYPT_SESSION_CMP_SERVER,                                 {  CMP server  }
    CRYPT_SESSION_SCEP,                                       {  SCEP  }
    CRYPT_SESSION_SCEP_SERVER,                                {  SCEP server  }
    CRYPT_SESSION_LAST                                        {  Last possible session type  }

    );

  {  User subtypes  }

  CRYPT_USER_TYPE = (
    CRYPT_USER_NONE,                                          {  No user type  }
    CRYPT_USER_NORMAL,                                        {  Normal user  }
    CRYPT_USER_SO,                                            {  Security officer  }
    CRYPT_USER_CA,                                            {  CA user  }
    CRYPT_USER_LAST                                           {  Last possible user type  }

    );

  {****************************************************************************
  *                                                                           *
  *                               Attribute Types                             *
  *                                                                           *
  ****************************************************************************}

  {  Attribute types.  These are arranged in the following order:

      PROPERTY    - Object property
      ATTRIBUTE   - Generic attributes
      OPTION      - Global or object-specific config.option
      CTXINFO     - Context-specific attribute
      CERTINFO    - Certificate-specific attribute
      KEYINFO     - Keyset-specific attribute

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -