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

📄 cryptlib.pas

📁 提供了很多种加密算法和CA认证及相关服务如CMP、OCSP等的开发
💻 PAS
📖 第 1 页 / 共 5 页
字号:
unit cryptlib;

interface

{****************************************************************************
*                                                                           *
*                        cryptlib External API Interface                    *
*                       Copyright Peter Gutmann 1997-2002                   *
*                                                                           *
*               adapted for Delphi Version 5 (32 bit) by W. Gothier         *
****************************************************************************}


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

 This file has been created automatically by a perl script ( with very little
 postprocessing manually) from the file:

 "cryptlib.h" dated Wed Jan 30 22:02:02 2002, filesize = 74310.

 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: hwg@gmx.de 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}


{  Alongside the externally visible types, cryptlib also has various internal
   types which are extended forms of the external types which are invisible
   to the user (eg SignedPublicKeyAndChallenge == certRequest).  These can
   only be used internally and are blocked by the security kernel, so they
   can never be accessed from outside cryptlib (in fact for good measure
   they're blocked before they even get to the kernel by preliminary range
   checks in the API wrapper functions).  The only reason they're defined
   here is because it's not possible to extend an enum outside the point
   where it's originally defined  }

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

{  Algorithm and mode types  }


type
  CRYPT_ALGO = 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 }
  { CRYPT_ALGO_SHA2,                { SHA2 placeholder }

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

  CRYPT_ALGO_LAST                                   = 303; { Last possible crypt algo value }
  
  { Vendors may want to use their own algorithms which 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_VENDOR1                                = 10000; 
  CRYPT_ALGO_VENDOR2                                = 10001; 
  CRYPT_ALGO_VENDOR3                                = 10002;


  { 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 = (                                      {  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_MYSQL,                               {  MySQL RDBMS  }
    CRYPT_KEYSET_DATABASE,                            {  Generic database plugin  }
    CRYPT_KEYSET_ODBC_STORE,                          {  ODBC certificate store  }
    CRYPT_KEYSET_MYSQL_STORE,                         {  MySQL certificate store  }
    CRYPT_KEYSET_DATABASE_STORE,                      {  Database 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_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_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;

type

{  Session subtypes  }

  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_OCSP,                               {  OCSP  }
    CRYPT_SESSION_OCSP_SERVER,                        {  OCSP server  }
    CRYPT_SESSION_TSP,                                {  TSP  }
    CRYPT_SESSION_TSP_SERVER,                         {  TSP server  }
    CRYPT_SESSION_CMP,                                {  PKIX CMP  }
    CRYPT_SESSION_CMP_SERVER,                         {  PKIX CMP 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
    DEVINFO     - Device-specific attribute
    ENVINFO     - Envelope-specific attribute
    SESSINFO    - Session-specific attribute
    USERINFO    - User-specific attribute  }

  CRYPT_ATTRIBUTE_TYPE = Integer;
const

  CRYPT_ATTRIBUTE_NONE                              = 0; { Non-value }

  { Used internally }
  CRYPT_PROPERTY_FIRST                              = 1;

  {*******************}
  { Object attributes }
  {*******************}

⌨️ 快捷键说明

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