├── .gitignore ├── LICENSE ├── Packages ├── CryptoBBoxAndroid.pp ├── CryptoBBoxB11.cbproj ├── CryptoBBoxB11.cpp ├── CryptoBBoxB12.cbproj ├── CryptoBBoxB12.cpp ├── CryptoBBoxB14.cbproj ├── CryptoBBoxB14.cpp ├── CryptoBBoxB15.cbproj ├── CryptoBBoxB15.cpp ├── CryptoBBoxB16.cbproj ├── CryptoBBoxB16.cpp ├── CryptoBBoxB17.cbproj ├── CryptoBBoxB17.cpp ├── CryptoBBoxB18.cbproj ├── CryptoBBoxB18.cpp ├── CryptoBBoxB19.cbproj ├── CryptoBBoxB19.cpp ├── CryptoBBoxB20.cbproj ├── CryptoBBoxB20.cpp ├── CryptoBBoxD11.bdsproj ├── CryptoBBoxD11.dpk ├── CryptoBBoxD11.dproj ├── CryptoBBoxD12.dpk ├── CryptoBBoxD12.dproj ├── CryptoBBoxD14.dpk ├── CryptoBBoxD14.dproj ├── CryptoBBoxD15.dpk ├── CryptoBBoxD15.dproj ├── CryptoBBoxD16.dpk ├── CryptoBBoxD16.dproj ├── CryptoBBoxD17.dpk ├── CryptoBBoxD17.dproj ├── CryptoBBoxD18.dpk ├── CryptoBBoxD18.dproj ├── CryptoBBoxD19.dpk ├── CryptoBBoxD19.dproj ├── CryptoBBoxD20.dpk ├── CryptoBBoxD20.dproj ├── CryptoBBoxD5.dpk ├── CryptoBBoxD6.dpk ├── CryptoBBoxD7.dpk ├── CryptoBBoxD9.bdsproj ├── CryptoBBoxD9.dpk ├── CryptoBBoxDX.bdsproj ├── CryptoBBoxDX.dpk ├── CryptoBBoxDX.dproj ├── CryptoBBoxDX.hpp ├── CryptoBBoxDX.otares ├── CryptoBBoxDX.res ├── CryptoBBoxLinux.pp ├── CryptoBBoxMac.pp ├── CryptoBBoxWin.pp ├── PlatformTargets.res ├── cryptobboxUnix.lpk ├── cryptobboxWin.lpk └── secbbox.dcr ├── README.md ├── Samples └── Delphi │ └── CryptoBlackbox │ ├── CertValidator │ ├── CertValidator.dpr │ ├── CertValidator.inc │ ├── CertValidator.res │ ├── CustomTransports.pas │ ├── MainFrm.dfm │ └── MainFrm.pas │ ├── Certificates │ ├── AboutForm.dfm │ ├── AboutForm.pas │ ├── CertDemo.dpr │ ├── CertDemo.inc │ ├── CertDemo.res │ ├── CertDemo_BDS2005.bdsproj │ ├── CertDemo_BDS2005.dpr │ ├── CertDemo_BDS2005.res │ ├── CertDemo_CRS2009.dproj │ ├── CertDemo_CRS2010.dproj │ ├── CertificateGenerationThread.pas │ ├── CountryList.pas │ ├── ExtensionEncoder.pas │ ├── SelectStorage.dfm │ ├── SelectStorage.pas │ ├── frmMain.dfm │ ├── frmMain.pas │ ├── readme.txt │ ├── uValidate.dfm │ └── uValidate.pas │ ├── Countersigning │ ├── CSDemo.dpr │ ├── CSDemo.res │ ├── CSDemo_BDS2005.bdsproj │ ├── CSDemo_BDS2005.dpr │ ├── CSDemo_BDS2005.res │ ├── CSDemo_CRS2009.dproj │ ├── CSDemo_CRS2010.dproj │ ├── Countersigning.inc │ ├── MainForm.dfm │ └── MainForm.pas │ ├── PKCS7 │ ├── MainForm.dfm │ ├── MainForm.pas │ ├── MessagesDemo.dpr │ ├── MessagesDemo.inc │ ├── MessagesDemo.res │ ├── MessagesDemo_BDS2005.bdsproj │ ├── MessagesDemo_BDS2005.dpr │ ├── MessagesDemo_BDS2005.res │ ├── MessagesDemo_CRS2009.dproj │ ├── MessagesDemo_CRS2010.dproj │ └── readme.txt │ ├── Primitives │ ├── Decrypt │ │ ├── Decrypt.dpr │ │ ├── Decrypt.inc │ │ ├── Decrypt.res │ │ ├── Decrypt_BDS2005.bdsproj │ │ ├── Decrypt_BDS2005.dpr │ │ ├── Decrypt_BDS2005.res │ │ ├── Decrypt_CRS2009.dproj │ │ ├── Decrypt_CRS2010.dproj │ │ ├── Unit1.dfm │ │ └── Unit1.pas │ ├── Encrypt │ │ ├── Encrypt.dpr │ │ ├── Encrypt.inc │ │ ├── Encrypt.res │ │ ├── Encrypt_BDS2005.bdsproj │ │ ├── Encrypt_BDS2005.dpr │ │ ├── Encrypt_BDS2005.res │ │ ├── Encrypt_CRS2009.dproj │ │ ├── Encrypt_CRS2010.dproj │ │ ├── Unit1.dfm │ │ └── Unit1.pas │ ├── SignDetached │ │ ├── SignDetached.dpr │ │ ├── SignDetached.inc │ │ ├── SignDetached.res │ │ ├── SignDetached_BDS2005.bdsproj │ │ ├── SignDetached_BDS2005.dpr │ │ ├── SignDetached_BDS2005.res │ │ ├── SignDetached_CRS2009.dproj │ │ ├── SignDetached_CRS2010.dproj │ │ ├── Unit1.dfm │ │ └── Unit1.pas │ └── VerifyDetached │ │ ├── Unit1.dfm │ │ ├── Unit1.pas │ │ ├── VerifyDetached.dpr │ │ ├── VerifyDetached.inc │ │ ├── VerifyDetached.res │ │ ├── VerifyDetached_BDS2005.bdsproj │ │ ├── VerifyDetached_BDS2005.dpr │ │ ├── VerifyDetached_BDS2005.res │ │ ├── VerifyDetached_CRS2009.dproj │ │ └── VerifyDetached_CRS2010.dproj │ ├── SymmetricCrypto │ ├── MainFrm.dfm │ ├── MainFrm.pas │ ├── SymmetricEncryption.dpr │ ├── SymmetricEncryption.inc │ └── SymmetricEncryption.res │ └── SymmetricCryptoWithJS │ ├── MainFrm.dfm │ ├── MainFrm.pas │ ├── SymmetricEncryptionWithJS.dpr │ ├── SymmetricEncryptionWithJS.html │ └── SymmetricEncryptionWithJS.inc ├── Sources ├── SBAES.hpp ├── SBAES.pas ├── SBASN1.hpp ├── SBASN1.pas ├── SBASN1Tree.hpp ├── SBASN1Tree.pas ├── SBAlgorithmIdentifier.hpp ├── SBAlgorithmIdentifier.pas ├── SBBCrypt.hpp ├── SBBCrypt.pas ├── SBBlowfish.hpp ├── SBBlowfish.pas ├── SBCAST128.hpp ├── SBCAST128.pas ├── SBCMSUtils.hpp ├── SBCMSUtils.pas ├── SBCRC.hpp ├── SBCRC.pas ├── SBCRL.hpp ├── SBCRL.pas ├── SBCRLStorage.hpp ├── SBCRLStorage.pas ├── SBCamellia.hpp ├── SBCamellia.pas ├── SBCertRetriever.hpp ├── SBCertRetriever.pas ├── SBCertStorageEditor.dfm ├── SBCertStorageEditor.pas ├── SBCertValidator.hpp ├── SBCertValidator.pas ├── SBChSCJKConsts.pas ├── SBChSClasses.hpp ├── SBChSClasses.pas ├── SBChSConv.hpp ├── SBChSConv.pas ├── SBChSConvBase.hpp ├── SBChSConvBase.pas ├── SBChSConvCharsets.hpp ├── SBChSConvCharsets.pas ├── SBChSConvConsts.hpp ├── SBChSConvConsts.pas ├── SBChSUnicode.inc ├── SBChSUnicode.pas ├── SBConstants.hpp ├── SBConstants.pas ├── SBCryptoProv.hpp ├── SBCryptoProv.pas ├── SBCryptoProvBuiltIn.hpp ├── SBCryptoProvBuiltIn.pas ├── SBCryptoProvBuiltInEx.hpp ├── SBCryptoProvBuiltInEx.pas ├── SBCryptoProvBuiltInHash.hpp ├── SBCryptoProvBuiltInHash.pas ├── SBCryptoProvBuiltInPKI.hpp ├── SBCryptoProvBuiltInPKI.pas ├── SBCryptoProvBuiltInSym.hpp ├── SBCryptoProvBuiltInSym.pas ├── SBCryptoProvDefault.hpp ├── SBCryptoProvDefault.pas ├── SBCryptoProvManager.hpp ├── SBCryptoProvManager.pas ├── SBCryptoProvRS.hpp ├── SBCryptoProvRS.pas ├── SBCryptoProvUtils.hpp ├── SBCryptoProvUtils.pas ├── SBCryptoProvWin32.hpp ├── SBCryptoProvWin32.pas ├── SBCustomCertStorage.hpp ├── SBCustomCertStorage.pas ├── SBCustomCrypto.hpp ├── SBCustomCrypto.pas ├── SBDES.hpp ├── SBDES.pas ├── SBDSA.hpp ├── SBDSA.pas ├── SBECCommon.hpp ├── SBECCommon.pas ├── SBECDSA.hpp ├── SBECDSA.pas ├── SBECMath.hpp ├── SBECMath.pas ├── SBElGamal.hpp ├── SBElgamal.pas ├── SBEncoding.hpp ├── SBEncoding.pas ├── SBGOST2814789.hpp ├── SBGOST2814789.pas ├── SBGOST341001.hpp ├── SBGOST341001.pas ├── SBGOST341094.hpp ├── SBGOST341094.pas ├── SBGOST341194.hpp ├── SBGOST341194.pas ├── SBGOSTCommon.hpp ├── SBGOSTCommon.pas ├── SBGSSAPI.pas ├── SBGSSAPIBase.pas ├── SBGSSWinAuth.pas ├── SBHMAC.hpp ├── SBHMAC.pas ├── SBHTTPAuth.hpp ├── SBHTTPAuth.pas ├── SBHTTPSConstants.hpp ├── SBHTTPSConstants.pas ├── SBHashFunction.hpp ├── SBHashFunction.pas ├── SBIDEA.hpp ├── SBIDEA.pas ├── SBJKS.hpp ├── SBJKS.pas ├── SBLicenseManager.pas ├── SBMD.hpp ├── SBMD.pas ├── SBMSKeyBlob.hpp ├── SBMSKeyBlob.pas ├── SBMath.hpp ├── SBMath.pas ├── SBMessages.hpp ├── SBMessages.pas ├── SBOCSPClient.hpp ├── SBOCSPClient.pas ├── SBOCSPCommon.hpp ├── SBOCSPCommon.pas ├── SBOCSPStorage.hpp ├── SBOCSPStorage.pas ├── SBPEM.hpp ├── SBPEM.pas ├── SBPKCS12.hpp ├── SBPKCS12.pas ├── SBPKCS5.hpp ├── SBPKCS5.pas ├── SBPKCS7.hpp ├── SBPKCS7.pas ├── SBPKCS7Utils.hpp ├── SBPKCS7Utils.pas ├── SBPKCS8.hpp ├── SBPKCS8.pas ├── SBPKIAsync.hpp ├── SBPKIAsync.pas ├── SBPKICommon.hpp ├── SBPKICommon.pas ├── SBPublicKeyCrypto.hpp ├── SBPublicKeyCrypto.pas ├── SBPunycode.hpp ├── SBPunycode.pas ├── SBRC2.hpp ├── SBRC2.pas ├── SBRC4.hpp ├── SBRC4.pas ├── SBRDN.hpp ├── SBRDN.pas ├── SBRIPEMD.hpp ├── SBRIPEMD.pas ├── SBRSA.hpp ├── SBRSA.pas ├── SBRabbit.hpp ├── SBRabbit.pas ├── SBRandom.hpp ├── SBRandom.pas ├── SBSASL.hpp ├── SBSASL.pas ├── SBSHA.hpp ├── SBSHA.pas ├── SBSHA2.hpp ├── SBSHA2.pas ├── SBSMIMESignatures.hpp ├── SBSMIMESignatures.pas ├── SBSRP.hpp ├── SBSRP.pas ├── SBSSPI.pas ├── SBSeed.hpp ├── SBSeed.pas ├── SBSerpent.hpp ├── SBSerpent.pas ├── SBSharedResource.hpp ├── SBSharedResource.pas ├── SBSocket.hpp ├── SBSocket.pas ├── SBSocketTSPClient.hpp ├── SBSocketTSPClient.pas ├── SBStrUtils.hpp ├── SBStrUtils.pas ├── SBStreams.hpp ├── SBStreams.pas ├── SBStringList.hpp ├── SBStringList.pas ├── SBSymmetricCrypto.hpp ├── SBSymmetricCrypto.pas ├── SBSystemStoreEditor.dfm ├── SBSystemStoreEditor.pas ├── SBTSPClient.hpp ├── SBTSPClient.pas ├── SBTSPCommon.hpp ├── SBTSPCommon.pas ├── SBTimer.hpp ├── SBTimer.pas ├── SBTwofish.hpp ├── SBTwofish.pas ├── SBTypes.hpp ├── SBTypes.pas ├── SBUMAC.hpp ├── SBUMAC.pas ├── SBUnicode.hpp ├── SBUnicode.pas ├── SBUtils.hpp ├── SBUtils.pas ├── SBWhirlpool.hpp ├── SBWhirlpool.pas ├── SBWinCertStorage.hpp ├── SBWinCertStorage.pas ├── SBWinCrypt.hpp ├── SBWinCrypt.pas ├── SBX509.hpp ├── SBX509.pas ├── SBX509Ext.hpp ├── SBX509Ext.pas ├── SBZCommonUnit.pas ├── SBZCompressUnit.hpp ├── SBZCompressUnit.pas ├── SBZUncompressUnit.hpp ├── SBZUncompressUnit.pas ├── SBZlib.hpp ├── SBZlib.pas ├── SBlicenseManager.hpp ├── SBzcommonunit.hpp └── SecBbox.inc ├── changes.txt └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | *.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | bin/ 63 | *.~* 64 | *.tmp 65 | 66 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 67 | *.stat 68 | *.sds 69 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB11.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | #pragma package(smart_init) 6 | //--------------------------------------------------------------------------- 7 | 8 | // Package source. 9 | //--------------------------------------------------------------------------- 10 | 11 | 12 | #pragma argsused 13 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 14 | { 15 | return 1; 16 | } 17 | //--------------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB12.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | #pragma package(smart_init) 6 | //--------------------------------------------------------------------------- 7 | 8 | // Package source. 9 | //--------------------------------------------------------------------------- 10 | 11 | 12 | #pragma argsused 13 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 14 | { 15 | return 1; 16 | } 17 | //--------------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB14.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | #pragma package(smart_init) 6 | //--------------------------------------------------------------------------- 7 | 8 | // Package source. 9 | //--------------------------------------------------------------------------- 10 | 11 | 12 | #pragma argsused 13 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 14 | { 15 | return 1; 16 | } 17 | //--------------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB15.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | #pragma package(smart_init) 6 | //--------------------------------------------------------------------------- 7 | 8 | // Package source. 9 | //--------------------------------------------------------------------------- 10 | 11 | 12 | #pragma argsused 13 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 14 | { 15 | return 1; 16 | } 17 | //--------------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB16.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | 6 | 7 | #pragma package(smart_init) 8 | //--------------------------------------------------------------------------- 9 | 10 | // Package source. 11 | //--------------------------------------------------------------------------- 12 | 13 | 14 | #pragma argsused 15 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 16 | { 17 | return 1; 18 | } 19 | //--------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB17.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | 6 | 7 | #pragma package(smart_init) 8 | //--------------------------------------------------------------------------- 9 | 10 | // Package source. 11 | //--------------------------------------------------------------------------- 12 | 13 | 14 | #pragma argsused 15 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 16 | { 17 | return 1; 18 | } 19 | //--------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB18.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | 6 | 7 | #pragma package(smart_init) 8 | //--------------------------------------------------------------------------- 9 | 10 | // Package source. 11 | //--------------------------------------------------------------------------- 12 | 13 | 14 | #pragma argsused 15 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 16 | { 17 | return 1; 18 | } 19 | //--------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB19.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | 6 | 7 | #pragma package(smart_init) 8 | //--------------------------------------------------------------------------- 9 | 10 | // Package source. 11 | //--------------------------------------------------------------------------- 12 | 13 | 14 | #pragma argsused 15 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 16 | { 17 | return 1; 18 | } 19 | //--------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxB20.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #include 4 | #pragma hdrstop 5 | 6 | 7 | #pragma package(smart_init) 8 | //--------------------------------------------------------------------------- 9 | 10 | // Package source. 11 | //--------------------------------------------------------------------------- 12 | 13 | 14 | #pragma argsused 15 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 16 | { 17 | return 1; 18 | } 19 | //--------------------------------------------------------------------------- 20 | -------------------------------------------------------------------------------- /Packages/CryptoBBoxDX.otares: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Packages/CryptoBBoxDX.otares -------------------------------------------------------------------------------- /Packages/CryptoBBoxDX.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Packages/CryptoBBoxDX.res -------------------------------------------------------------------------------- /Packages/PlatformTargets.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Packages/PlatformTargets.res -------------------------------------------------------------------------------- /Packages/secbbox.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Packages/secbbox.dcr -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cryptobboxvcl 2 | CryptoBlackbox was a free package of SecureBlackbox product, offered for .NET, Java and VCL platforms. 3 | 4 | ### Compilation guide 5 | In order to compile this sources with Embarcadero RAD Studio 10 Seattle, you need to setup the following conditional defines in project settings: 6 | - SB_UNICODE_VCL 7 | - SB_UNICODE_WINAPI 8 | - SB_PASCAL_STRINGS 9 | - SB_NO_BYTEARRAY_CONST_ARRAYS 10 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/CertValidator/CertValidator.dpr: -------------------------------------------------------------------------------- 1 | program CertValidator; 2 | 3 | {$i CertValidator.inc} 4 | 5 | uses 6 | Forms, 7 | MainFrm in 'MainFrm.pas' {Form1} 8 | {$ifndef CRYPTOBLACKBOX} 9 | , CustomTransports in 'CustomTransports.pas' 10 | {$endif} 11 | ; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | Application.Initialize; 17 | Application.CreateForm(TForm1, Form1); 18 | Application.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/CertValidator/CertValidator.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/CertValidator/CertValidator.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/CertValidator/CertValidator.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/AboutForm.dfm: -------------------------------------------------------------------------------- 1 | object frmAbout: TfrmAbout 2 | Left = 192 3 | Top = 107 4 | BorderStyle = bsDialog 5 | Caption = 'About' 6 | ClientHeight = 147 7 | ClientWidth = 234 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | Position = poScreenCenter 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object lTitle: TLabel 19 | Left = 0 20 | Top = 24 21 | Width = 233 22 | Height = 13 23 | Alignment = taCenter 24 | AutoSize = False 25 | Caption = 'X.509 certificates demo application' 26 | end 27 | object lProduct: TLabel 28 | Left = 0 29 | Top = 48 30 | Width = 233 31 | Height = 13 32 | Alignment = taCenter 33 | AutoSize = False 34 | Caption = 'EldoS SecureBlackbox library' 35 | end 36 | object lCopyright: TLabel 37 | Left = 0 38 | Top = 72 39 | Width = 233 40 | Height = 13 41 | Alignment = taCenter 42 | AutoSize = False 43 | Caption = 'Copyright (C) 2006-2011 EldoS Corporation' 44 | end 45 | object btnOK: TButton 46 | Left = 80 47 | Top = 104 48 | Width = 75 49 | Height = 25 50 | Cancel = True 51 | Caption = 'OK' 52 | Default = True 53 | ModalResult = 1 54 | TabOrder = 0 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/AboutForm.pas: -------------------------------------------------------------------------------- 1 | unit AboutForm; 2 | 3 | interface 4 | 5 | uses 6 | Windows,Messages,SysUtils,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls; 7 | 8 | type 9 | TfrmAbout = class(TForm) 10 | lTitle: TLabel; 11 | lProduct: TLabel; 12 | lCopyright: TLabel; 13 | btnOK: TButton; 14 | private 15 | { Private declarations } 16 | public 17 | { Public declarations } 18 | class procedure ShowAboutBox; 19 | end; 20 | 21 | var 22 | frmAbout: TfrmAbout; 23 | 24 | implementation 25 | 26 | {$R *.DFM} 27 | 28 | { TfrmAbout } 29 | 30 | class procedure TfrmAbout.ShowAboutBox; 31 | begin 32 | with TfrmAbout.Create(nil) do ShowModal; 33 | end; 34 | 35 | end. 36 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertDemo.dpr: -------------------------------------------------------------------------------- 1 | program CertDemo; 2 | 3 | {%ToDo 'CertDemo.todo'} 4 | 5 | uses 6 | Forms, 7 | frmMain in 'frmMain.pas' {MainForm}, 8 | SelectStorage in 'SelectStorage.pas' {StorageSelectForm}, 9 | CountryList in 'CountryList.pas', 10 | AboutForm in 'AboutForm.pas' {frmAbout}, 11 | ExtensionEncoder in 'ExtensionEncoder.pas', 12 | uValidate in 'uValidate.pas' {frmValidate}; 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TMainForm, MainForm); 17 | Application.CreateForm(TfrmAbout, frmAbout); 18 | Application.Run; 19 | end. 20 | 21 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertDemo.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} 2 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Certificates/CertDemo.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertDemo_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program CertDemo_BDS2005; 2 | 3 | {%ToDo 'CertDemo.todo'} 4 | {%ToDo 'CertDemo_BDS2005.todo'} 5 | 6 | uses 7 | Forms, 8 | frmMain in 'frmMain.pas' {MainForm}, 9 | GenerateCert in 'GenerateCert.pas' {frmGenerateCert}, 10 | SelectStorage in 'SelectStorage.pas' {StorageSelectForm}, 11 | CountryList in 'CountryList.pas', 12 | AboutForm in 'AboutForm.pas' {frmAbout}, 13 | ExtensionEncoder in 'ExtensionEncoder.pas', 14 | uValidate in 'uValidate.pas' {frmValidate}; 15 | 16 | 17 | 18 | begin 19 | Application.Initialize; 20 | Application.CreateForm(TMainForm, MainForm); 21 | Application.CreateForm(TfrmAbout, frmAbout); 22 | Application.Run; 23 | end. 24 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertDemo_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Certificates/CertDemo_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/CertificateGenerationThread.pas: -------------------------------------------------------------------------------- 1 | unit CertificateGenerationThread; 2 | 3 | interface 4 | 5 | uses 6 | Classes, 7 | SBX509, 8 | SBX509Ex, 9 | SBAlgorithmIdentifier, 10 | SBTypes, 11 | SBUtils; 12 | 13 | type 14 | TCertificateGenerationThread = class(TThread) 15 | private 16 | FCert : TElX509CertificateEx; 17 | FCACert : TElX509CertificateEx; 18 | FKeyAlgorithm : TElAlgorithmIdentifier; 19 | FSignatureAlgorithm : TElAlgorithmIdentifier; 20 | FBits : integer; 21 | public 22 | constructor Create(CreateSuspended: Boolean); overload; 23 | constructor Create(CACert,Cert : TElX509CertificateEx); overload; 24 | destructor Destroy; override; 25 | procedure Execute; override; 26 | 27 | property CACert : TElX509CertificateEx read FCACert; 28 | property Cert : TElX509CertificateEx read FCert; 29 | property KeyAlgorithm : TElAlgorithmIdentifier read FKeyAlgorithm write FKeyAlgorithm; 30 | property SignatureAlgorithm : TElAlgorithmIdentifier read FSignatureAlgorithm write FSignatureAlgorithm; 31 | property Bits : integer read FBits write FBits; 32 | end; 33 | 34 | implementation 35 | 36 | constructor TCertificateGenerationThread.Create(CreateSuspended: Boolean); 37 | begin 38 | inherited Create(CreateSuspended); 39 | 40 | FKeyAlgorithm := nil; 41 | FSignatureAlgorithm := nil; 42 | end; 43 | 44 | destructor TCertificateGenerationThread.Destroy; 45 | begin 46 | inherited; 47 | end; 48 | 49 | procedure TCertificateGenerationThread.Execute; 50 | begin 51 | if not Assigned(FCACert) then 52 | FCert.Generate(FKeyAlgorithm, FSignatureAlgorithm, FBits) 53 | else 54 | FCert.Generate(FCACert, FKeyAlgorithm, FSignatureAlgorithm, FBits); 55 | end; 56 | 57 | constructor TCertificateGenerationThread.Create(CACert, Cert : TElX509CertificateEx); 58 | begin 59 | inherited Create(true); 60 | 61 | Self.FreeOnTerminate := true; 62 | FCert := Cert; 63 | FCACert := CACert; 64 | end; 65 | 66 | end. 67 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/SelectStorage.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Certificates/SelectStorage.dfm -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/SelectStorage.pas: -------------------------------------------------------------------------------- 1 | unit SelectStorage; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | StdCtrls, SBCustomCertStorage, SBWinCertStorage, ComCtrls; 8 | 9 | type 10 | TStorageSelectForm = class(TForm) 11 | lblSelectStorage: TLabel; 12 | btnOk: TButton; 13 | treeStorage: TTreeView; 14 | btnCancel: TButton; 15 | procedure btnOkClick(Sender: TObject); 16 | procedure FormActivate(Sender: TObject); 17 | procedure btnCancelClick(Sender: TObject); 18 | private 19 | { Private declarations } 20 | public 21 | { Public declarations } 22 | end; 23 | 24 | var 25 | StorageSelectForm: TStorageSelectForm; 26 | 27 | implementation 28 | 29 | uses frmMain; 30 | 31 | {$R *.DFM} 32 | 33 | procedure TStorageSelectForm.btnOkClick(Sender: TObject); 34 | begin 35 | if (treeStorage.Selected <> nil) and (treeStorage.Selected.Data <> nil) then 36 | begin 37 | ModalResult := mrOk; 38 | end 39 | else 40 | ShowMessage('Storage is not selected'); 41 | end; 42 | 43 | procedure TStorageSelectForm.FormActivate(Sender: TObject); 44 | var I, J : integer; 45 | begin 46 | with treeStorage do 47 | begin 48 | Items.Clear; 49 | Items.Add(nil, 'Storages'); 50 | Items.AddChild(Items[0], 'Windows Storages'); 51 | Items.AddChild(Items[0], 'File Storages'); 52 | Items.AddChild(Items[0], 'Memory Storages'); 53 | for I := 0 to 2 do 54 | for J := 0 to MainForm.treeCert.Items[0].Item[I].Count - 1 do 55 | Items.AddChildObject(Items[0].Item[I], 56 | MainForm.treeCert.Items[0].Item[I].Item[J].Text, 57 | MainForm.treeCert.Items[0].Item[I].Item[J].Data); 58 | end; 59 | end; 60 | 61 | procedure TStorageSelectForm.btnCancelClick(Sender: TObject); 62 | begin 63 | if MessageDlg('Are you sure you want to cancel operation?', 64 | mtConfirmation, [mbYes, mbNo], 0) = mrYes then 65 | begin 66 | ModalResult := mrCancel; 67 | end; 68 | end; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Certificates/readme.txt: -------------------------------------------------------------------------------- 1 | This sample illustrates use of Certificate Storages (TElMemoryCertStorage, 2 | TElFileCertStorage) to manage X.509 certificates (TElX509Certificate). 3 | 4 | Also certificate generation and export/import to various formats are shown. -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo.dpr: -------------------------------------------------------------------------------- 1 | program CSDemo; 2 | 3 | uses 4 | Forms, 5 | MainForm in 'MainForm.pas' {frmMain}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfrmMain, frmMain); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program CSDemo_BDS2005; 2 | 3 | uses 4 | Forms, 5 | MainForm in 'MainForm.pas' {frmMain}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfrmMain, frmMain); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo_CRS2009.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {5ABA875F-52EB-4EA1-BD09-89A5820345DC} 4 | CSDemo.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | CSDemo.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMain
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | CSDemo.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/CSDemo_CRS2010.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {5ABA875F-52EB-4EA1-BD09-89A5820345DC} 4 | CSDemo.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | CSDemo.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMain
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | CSDemo.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Countersigning/Countersigning.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo.dpr: -------------------------------------------------------------------------------- 1 | program MessagesDemo; 2 | 3 | uses 4 | Forms, 5 | MainForm in 'MainForm.pas' {Form1}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TForm1, Form1); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program MessagesDemo_BDS2005; 2 | 3 | uses 4 | Forms, 5 | MainForm in 'MainForm.pas' {Form1}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TForm1, Form1); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/PKCS7/MessagesDemo_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/PKCS7/readme.txt: -------------------------------------------------------------------------------- 1 | This sample illustrates PKCS#7-compatible signing/verification and 2 | encryption/decryption methods (using TElMessageSigner/TElMessageVerifier and 3 | TElMessageEncryptor/TElMessageDecryptor classes) which use X.509 certificates 4 | (TElX509Certificate). -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt.dpr: -------------------------------------------------------------------------------- 1 | program Decrypt; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto decryption demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program Decrypt_BDS2005; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto decryption demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt_CRS2009.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {A5E02E08-3E22-4A57-BEED-B980DAA89995} 4 | Decrypt.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | Decrypt.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMainForm
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | Decrypt.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Decrypt/Decrypt_CRS2010.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {A5E02E08-3E22-4A57-BEED-B980DAA89995} 4 | Decrypt.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | Decrypt.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMainForm
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | Decrypt.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt.dpr: -------------------------------------------------------------------------------- 1 | program Encrypt; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto encryption demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program Encrypt_BDS2005; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto encryption demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt_CRS2009.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {F7AC77E9-EBE1-4AA2-9413-5E4BB9EE349B} 4 | Encrypt.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | Encrypt.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMainForm
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | Encrypt.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/Encrypt/Encrypt_CRS2010.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {F7AC77E9-EBE1-4AA2-9413-5E4BB9EE349B} 4 | Encrypt.dpr 5 | Debug 6 | DCC32 7 | 12.0 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | Base 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | 00400000 24 | false 25 | x86 26 | Encrypt.exe 27 | false 28 | false 29 | false 30 | false 31 | 32 | 33 | false 34 | RELEASE;$(DCC_Define) 35 | 0 36 | false 37 | 38 | 39 | DEBUG;$(DCC_Define) 40 | 41 | 42 | 43 | MainSource 44 | 45 | 46 |
frmMainForm
47 |
48 | 49 | Base 50 | 51 | 52 | Cfg_2 53 | Base 54 | 55 | 56 | Cfg_1 57 | Base 58 | 59 |
60 | 61 | 62 | Delphi.Personality.12 63 | VCLApplication 64 | 65 | 66 | 67 | Encrypt.dpr 68 | 69 | 70 | False 71 | True 72 | False 73 | 74 | 75 | False 76 | False 77 | 1 78 | 0 79 | 0 80 | 0 81 | False 82 | False 83 | False 84 | False 85 | False 86 | 1033 87 | 1252 88 | 89 | 90 | 91 | 92 | 1.0.0.0 93 | 94 | 95 | 96 | 97 | 98 | 1.0.0.0 99 | 100 | 101 | 102 | 103 | 12 104 | 105 |
106 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached.dpr: -------------------------------------------------------------------------------- 1 | program SignDetached; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto signing with detached signature demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program SignDetached_BDS2005; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.Title := 'ElPublicKeyCrypto signing with detached signature demo'; 12 | Application.CreateForm(TfrmMainForm, frmMainForm); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/SignDetached/SignDetached_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached.dpr: -------------------------------------------------------------------------------- 1 | program VerifyDetached; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfrmMainForm, frmMainForm); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached_BDS2005.dpr: -------------------------------------------------------------------------------- 1 | program VerifyDetached_BDS2005; 2 | 3 | uses 4 | Forms, 5 | Unit1 in 'Unit1.pas' {frmMainForm}; 6 | 7 | 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfrmMainForm, frmMainForm); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached_BDS2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/Primitives/VerifyDetached/VerifyDetached_BDS2005.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCrypto/MainFrm.dfm: -------------------------------------------------------------------------------- 1 | object fmMain: TfmMain 2 | Left = 283 3 | Top = 153 4 | BorderStyle = bsDialog 5 | Caption = 'Symmetric Encryption Sample' 6 | ClientHeight = 243 7 | ClientWidth = 352 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | OnCreate = FormCreate 16 | OnDestroy = FormDestroy 17 | PixelsPerInch = 96 18 | TextHeight = 13 19 | object Label1: TLabel 20 | Left = 16 21 | Top = 16 22 | Width = 55 23 | Height = 13 24 | Caption = 'Input string:' 25 | end 26 | object Label4: TLabel 27 | Left = 16 28 | Top = 64 29 | Width = 49 30 | Height = 13 31 | Caption = 'Password:' 32 | end 33 | object Label5: TLabel 34 | Left = 16 35 | Top = 160 36 | Width = 80 37 | Height = 13 38 | Caption = 'Decrypted string:' 39 | end 40 | object Label2: TLabel 41 | Left = 16 42 | Top = 112 43 | Width = 84 44 | Height = 13 45 | Caption = 'Encrypted output:' 46 | end 47 | object edInputStr: TEdit 48 | Left = 16 49 | Top = 32 50 | Width = 321 51 | Height = 21 52 | TabOrder = 0 53 | Text = 'Input String' 54 | end 55 | object edEncryptedStr: TEdit 56 | Left = 16 57 | Top = 128 58 | Width = 321 59 | Height = 21 60 | TabOrder = 1 61 | end 62 | object bbEncrypt: TButton 63 | Left = 96 64 | Top = 206 65 | Width = 75 66 | Height = 25 67 | Caption = 'Encrypt' 68 | TabOrder = 2 69 | OnClick = bbEncryptClick 70 | end 71 | object bbDecrypt: TButton 72 | Left = 176 73 | Top = 206 74 | Width = 75 75 | Height = 25 76 | Caption = 'Decrypt' 77 | TabOrder = 3 78 | OnClick = bbDecryptClick 79 | end 80 | object edDecryptedStr: TEdit 81 | Left = 16 82 | Top = 176 83 | Width = 321 84 | Height = 21 85 | ReadOnly = True 86 | TabOrder = 4 87 | end 88 | object edPassword: TEdit 89 | Left = 16 90 | Top = 80 91 | Width = 321 92 | Height = 21 93 | TabOrder = 5 94 | end 95 | end 96 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCrypto/SymmetricEncryption.dpr: -------------------------------------------------------------------------------- 1 | program SymmetricEncryption; 2 | 3 | uses 4 | Forms, 5 | MainFrm in 'MainFrm.pas' {Form1}; 6 | 7 | {$R *.RES} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfmMain, fmMain); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCrypto/SymmetricEncryption.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCrypto/SymmetricEncryption.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Samples/Delphi/CryptoBlackbox/SymmetricCrypto/SymmetricEncryption.res -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCryptoWithJS/MainFrm.dfm: -------------------------------------------------------------------------------- 1 | object fmMain: TfmMain 2 | Left = 686 3 | Top = 363 4 | BorderStyle = bsDialog 5 | Caption = 'Symmetric Encryption with JavaScript Sample' 6 | ClientHeight = 403 7 | ClientWidth = 357 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | OnCreate = FormCreate 16 | OnDestroy = FormDestroy 17 | PixelsPerInch = 96 18 | TextHeight = 13 19 | object Label1: TLabel 20 | Left = 16 21 | Top = 120 22 | Width = 80 23 | Height = 13 24 | Caption = 'String to encrypt:' 25 | end 26 | object Label4: TLabel 27 | Left = 16 28 | Top = 168 29 | Width = 49 30 | Height = 13 31 | Caption = 'Password:' 32 | end 33 | object Label5: TLabel 34 | Left = 16 35 | Top = 328 36 | Width = 80 37 | Height = 13 38 | Caption = 'Decrypted string:' 39 | end 40 | object Label2: TLabel 41 | Left = 16 42 | Top = 280 43 | Width = 335 44 | Height = 13 45 | Caption = 46 | 'Encrypted, base64-encoded output (can be with salt, like in Open' + 47 | 'SSL):' 48 | end 49 | object Label7: TLabel 50 | Left = 16 51 | Top = 232 52 | Width = 21 53 | Height = 13 54 | Caption = 'Key:' 55 | end 56 | object Label8: TLabel 57 | Left = 16 58 | Top = 256 59 | Width = 13 60 | Height = 13 61 | Caption = 'IV:' 62 | end 63 | object Label9: TLabel 64 | Left = 16 65 | Top = 192 66 | Width = 21 67 | Height = 13 68 | Caption = 'Salt:' 69 | end 70 | object Label6: TLabel 71 | Left = 16 72 | Top = 8 73 | Width = 324 74 | Height = 78 75 | Caption = 76 | 'Javascript-compatible encryption (crypto-js) demo. You can use p' + 77 | 'assword to generate key and iv, or paste hex-encoded key and iv' + 78 | '. Salt is used to randomize password and should be passed with p' + 79 | 'assword to JavaScript. This sample uses PBKDF2 key-derivation fu' + 80 | 'nction, and AES-256 CBC encryption with PKCS#5 (PKCS#7) padding' + 81 | '.' 82 | WordWrap = True 83 | end 84 | object Label3: TLabel 85 | Left = 72 86 | Top = 208 87 | Width = 220 88 | Height = 13 89 | Caption = '* clear Salt value to generate new salt and key' 90 | end 91 | object edInputStr: TEdit 92 | Left = 16 93 | Top = 136 94 | Width = 329 95 | Height = 21 96 | TabOrder = 0 97 | Text = 'Input String!!!' 98 | end 99 | object edEncryptedStr: TEdit 100 | Left = 16 101 | Top = 296 102 | Width = 329 103 | Height = 21 104 | TabOrder = 1 105 | end 106 | object bbEncrypt: TButton 107 | Left = 96 108 | Top = 374 109 | Width = 75 110 | Height = 25 111 | Caption = 'Encrypt' 112 | TabOrder = 2 113 | OnClick = bbEncryptClick 114 | end 115 | object bbDecrypt: TButton 116 | Left = 176 117 | Top = 374 118 | Width = 75 119 | Height = 25 120 | Caption = 'Decrypt' 121 | TabOrder = 3 122 | OnClick = bbDecryptClick 123 | end 124 | object edDecryptedStr: TEdit 125 | Left = 16 126 | Top = 344 127 | Width = 329 128 | Height = 21 129 | ReadOnly = True 130 | TabOrder = 4 131 | end 132 | object edPassword: TEdit 133 | Left = 72 134 | Top = 160 135 | Width = 169 136 | Height = 21 137 | TabOrder = 5 138 | end 139 | object bbGenerateKey: TButton 140 | Left = 248 141 | Top = 160 142 | Width = 97 143 | Height = 22 144 | Caption = 'Generate key' 145 | TabOrder = 6 146 | OnClick = bbGenerateKeyClick 147 | end 148 | object edSalt: TEdit 149 | Left = 72 150 | Top = 184 151 | Width = 273 152 | Height = 21 153 | TabOrder = 7 154 | end 155 | object edKey: TEdit 156 | Left = 72 157 | Top = 224 158 | Width = 273 159 | Height = 21 160 | TabOrder = 8 161 | end 162 | object edIV: TEdit 163 | Left = 72 164 | Top = 248 165 | Width = 273 166 | Height = 21 167 | TabOrder = 9 168 | end 169 | end 170 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCryptoWithJS/SymmetricEncryptionWithJS.dpr: -------------------------------------------------------------------------------- 1 | program SymmetricEncryptionWithJS; 2 | 3 | uses 4 | Forms, 5 | MainFrm in 'MainFrm.pas' {Form1}; 6 | 7 | {$R *.RES} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.CreateForm(TfmMain, fmMain); 12 | Application.Run; 13 | end. 14 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCryptoWithJS/SymmetricEncryptionWithJS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is example HTML page to test interoperability of EldoS SecureBlackbox and crypto-js JavaScript encryption library.
4 | It uses following cipher parameters, which can be easily changed: cipher is AES-256, CBC mode with PKCS#5 (PKCS #7) padding. PBKDF2 is used to derive key and iv from password.

5 | 6 | 7 | 8 | 9 | 10 | 92 | 93 |
94 | Text to encrypt:
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |
Password  
Salt
* clear salt value to generate new salt and key
Key
IV
115 | 116 | Encrypted, base64-encoded output:
117 |
118 | Decrypted string:
119 |
120 |   
121 | 122 |
123 | 124 | 125 | -------------------------------------------------------------------------------- /Samples/Delphi/CryptoBlackbox/SymmetricCryptoWithJS/SymmetricEncryptionWithJS.inc: -------------------------------------------------------------------------------- 1 | {$define CRYPTOBLACKBOX} -------------------------------------------------------------------------------- /Sources/SBAES.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbaes.pas' rev: 21.00 6 | 7 | #ifndef SbaesHPP 8 | #define SbaesHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbaes 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | typedef StaticArray TAESBuffer; 26 | 27 | typedef TAESBuffer *PAESBuffer; 28 | 29 | typedef StaticArray TAESKey128; 30 | 31 | typedef StaticArray TAESExpandedKey128; 32 | 33 | typedef TAESKey128 *PAESKey128; 34 | 35 | typedef TAESExpandedKey128 *PAESExpandedKey128; 36 | 37 | typedef StaticArray TAESKey192; 38 | 39 | typedef StaticArray TAESExpandedKey192; 40 | 41 | typedef TAESKey192 *PAESKey192; 42 | 43 | typedef TAESExpandedKey192 *PAESExpandedKey192; 44 | 45 | typedef StaticArray TAESKey256; 46 | 47 | typedef StaticArray TAESExpandedKey256; 48 | 49 | typedef TAESKey256 *PAESKey256; 50 | 51 | typedef TAESExpandedKey256 *PAESExpandedKey256; 52 | 53 | //-- var, const, procedure --------------------------------------------------- 54 | static const ShortInt TAESBufferSize = 0x10; 55 | extern PACKAGE void __fastcall ExpandKeyForEncryption128(System::Byte const *Key, /* out */ unsigned *ExpandedKey)/* overload */; 56 | extern PACKAGE void __fastcall ExpandKeyForEncryption192(System::Byte const *Key, /* out */ unsigned *ExpandedKey)/* overload */; 57 | extern PACKAGE void __fastcall ExpandKeyForEncryption256(System::Byte const *Key, /* out */ unsigned *ExpandedKey)/* overload */; 58 | extern PACKAGE void __fastcall ExpandKeyForDecryption128(unsigned *ExpandedKey)/* overload */; 59 | extern PACKAGE void __fastcall ExpandKeyForDecryption192(unsigned *ExpandedKey)/* overload */; 60 | extern PACKAGE void __fastcall ExpandKeyForDecryption256(unsigned *ExpandedKey)/* overload */; 61 | extern PACKAGE void __fastcall Encrypt128(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 62 | extern PACKAGE void __fastcall Encrypt192(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 63 | extern PACKAGE void __fastcall Encrypt256(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 64 | extern PACKAGE void __fastcall Decrypt128(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 65 | extern PACKAGE void __fastcall Decrypt192(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 66 | extern PACKAGE void __fastcall Decrypt256(System::Byte const *InBuf, unsigned const *Key, /* out */ System::Byte *OutBuf)/* overload */; 67 | extern PACKAGE void __fastcall Encrypt128(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 68 | extern PACKAGE void __fastcall Encrypt192(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 69 | extern PACKAGE void __fastcall Encrypt256(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 70 | extern PACKAGE void __fastcall Decrypt128(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 71 | extern PACKAGE void __fastcall Decrypt192(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 72 | extern PACKAGE void __fastcall Decrypt256(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, unsigned const *Key)/* overload */; 73 | 74 | } /* namespace Sbaes */ 75 | using namespace Sbaes; 76 | #pragma pack(pop) 77 | #pragma option pop 78 | 79 | #pragma delphiheader end. 80 | //-- end unit ---------------------------------------------------------------- 81 | #endif // SbaesHPP 82 | -------------------------------------------------------------------------------- /Sources/SBBlowfish.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbblowfish.pas' rev: 21.00 6 | 7 | #ifndef SbblowfishHPP 8 | #define SbblowfishHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | 21 | //-- user supplied ----------------------------------------------------------- 22 | 23 | namespace Sbblowfish 24 | { 25 | //-- type declarations ------------------------------------------------------- 26 | struct TSBBlowfishContext 27 | { 28 | 29 | public: 30 | unsigned P0; 31 | unsigned P1; 32 | unsigned P2; 33 | unsigned P3; 34 | unsigned P4; 35 | unsigned P5; 36 | unsigned P6; 37 | unsigned P7; 38 | unsigned P8; 39 | unsigned P9; 40 | unsigned P10; 41 | unsigned P11; 42 | unsigned P12; 43 | unsigned P13; 44 | unsigned P14; 45 | unsigned P15; 46 | unsigned P16; 47 | unsigned P17; 48 | StaticArray S0; 49 | StaticArray S1; 50 | StaticArray S2; 51 | StaticArray S3; 52 | }; 53 | 54 | 55 | //-- var, const, procedure --------------------------------------------------- 56 | extern PACKAGE void __fastcall EncryptBlock(TSBBlowfishContext &Context, unsigned &L, unsigned &R); 57 | extern PACKAGE void __fastcall DecryptBlock(TSBBlowfishContext &Context, unsigned &L, unsigned &R); 58 | extern PACKAGE void __fastcall Initialize(TSBBlowfishContext &Context, const Sbtypes::ByteArray Key); 59 | extern PACKAGE void __fastcall EksInitialize(TSBBlowfishContext &Context, int Rounds, const Sbtypes::ByteArray Salt, const Sbtypes::ByteArray Key); 60 | 61 | } /* namespace Sbblowfish */ 62 | using namespace Sbblowfish; 63 | #pragma pack(pop) 64 | #pragma option pop 65 | 66 | #pragma delphiheader end. 67 | //-- end unit ---------------------------------------------------------------- 68 | #endif // SbblowfishHPP 69 | -------------------------------------------------------------------------------- /Sources/SBCAST128.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcast128.pas' rev: 21.00 6 | 7 | #ifndef Sbcast128HPP 8 | #define Sbcast128HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbcast128 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef StaticArray TCAST128Key; 28 | 29 | typedef TCAST128Key *PCAST128Key; 30 | 31 | typedef StaticArray TCAST128ExpandedKey; 32 | 33 | typedef StaticArray TCAST128Buffer; 34 | 35 | typedef TCAST128Buffer *PCAST128Buffer; 36 | 37 | typedef unsigned *PLongWord; 38 | 39 | //-- var, const, procedure --------------------------------------------------- 40 | extern PACKAGE void __fastcall ExpandKey(System::Byte const *Key, /* out */ unsigned *ExpandedKey); 41 | extern PACKAGE void __fastcall Encrypt16(unsigned &B0, unsigned &B1, unsigned *ExpandedKey); 42 | extern PACKAGE void __fastcall Decrypt16(unsigned &B0, unsigned &B1, unsigned *ExpandedKey); 43 | 44 | } /* namespace Sbcast128 */ 45 | using namespace Sbcast128; 46 | #pragma pack(pop) 47 | #pragma option pop 48 | 49 | #pragma delphiheader end. 50 | //-- end unit ---------------------------------------------------------------- 51 | #endif // Sbcast128HPP 52 | -------------------------------------------------------------------------------- /Sources/SBCMSUtils.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcmsutils.pas' rev: 21.00 6 | 7 | #ifndef SbcmsutilsHPP 8 | #define SbcmsutilsHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbcmsutils 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef void __fastcall (__closure *TSBCMSCertificateNeededEvent)(System::TObject* Sender, Sbcustomcertstorage::TElCertificateLookup* Lookup, Sbx509::TElX509Certificate* &Cert); 28 | 29 | //-- var, const, procedure --------------------------------------------------- 30 | 31 | } /* namespace Sbcmsutils */ 32 | using namespace Sbcmsutils; 33 | #pragma pack(pop) 34 | #pragma option pop 35 | 36 | #pragma delphiheader end. 37 | //-- end unit ---------------------------------------------------------------- 38 | #endif // SbcmsutilsHPP 39 | -------------------------------------------------------------------------------- /Sources/SBCMSUtils.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SecBbox.inc} 11 | 12 | unit SBCMSUtils; 13 | 14 | interface 15 | 16 | uses 17 | SBCustomCertStorage, 18 | SBX509, 19 | SBTypes, 20 | SBUtils; 21 | 22 | 23 | 24 | type 25 | TSBCMSCertificateNeededEvent = procedure(Sender: TObject; 26 | Lookup : TElCertificateLookup; var Cert : TElX509Certificate) of object; 27 | 28 | implementation 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /Sources/SBCRC.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcrc.pas' rev: 21.00 6 | 7 | #ifndef SbcrcHPP 8 | #define SbcrcHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | 19 | //-- user supplied ----------------------------------------------------------- 20 | 21 | namespace Sbcrc 22 | { 23 | //-- type declarations ------------------------------------------------------- 24 | //-- var, const, procedure --------------------------------------------------- 25 | extern PACKAGE StaticArray CRC32Table; 26 | extern PACKAGE unsigned __fastcall CRC32(void * Buffer, int Size, unsigned Start)/* overload */; 27 | extern PACKAGE unsigned __fastcall CRC32(void * Buffer, int Size)/* overload */; 28 | 29 | } /* namespace Sbcrc */ 30 | using namespace Sbcrc; 31 | #pragma pack(pop) 32 | #pragma option pop 33 | 34 | #pragma delphiheader end. 35 | //-- end unit ---------------------------------------------------------------- 36 | #endif // SbcrcHPP 37 | -------------------------------------------------------------------------------- /Sources/SBCRC.pas: -------------------------------------------------------------------------------- 1 | 2 | (******************************************************) 3 | (* *) 4 | (* EldoS SecureBlackbox Library *) 5 | (* *) 6 | (* Copyright (c) 2002-2014 EldoS Corporation *) 7 | (* http://www.secureblackbox.com *) 8 | (* *) 9 | (******************************************************) 10 | 11 | {$I SecBbox.inc} 12 | 13 | unit SBCRC; 14 | 15 | interface 16 | 17 | uses 18 | SBTypes; 19 | 20 | 21 | function CRC32(Buffer : pointer; Size : integer) : cardinal;overload; 22 | function CRC32(Buffer : pointer; Size : integer; Start:cardinal) : cardinal;overload; 23 | 24 | const 25 | CRC32Table : array[0..255] of cardinal = 26 | ( 27 | $00000000, $77073096, $ee0e612c, $990951ba, $076dc419, 28 | $706af48f, $e963a535, $9e6495a3, $0edb8832, $79dcb8a4, 29 | $e0d5e91e, $97d2d988, $09b64c2b, $7eb17cbd, $e7b82d07, 30 | $90bf1d91, $1db71064, $6ab020f2, $f3b97148, $84be41de, 31 | $1adad47d, $6ddde4eb, $f4d4b551, $83d385c7, $136c9856, 32 | $646ba8c0, $fd62f97a, $8a65c9ec, $14015c4f, $63066cd9, 33 | $fa0f3d63, $8d080df5, $3b6e20c8, $4c69105e, $d56041e4, 34 | $a2677172, $3c03e4d1, $4b04d447, $d20d85fd, $a50ab56b, 35 | $35b5a8fa, $42b2986c, $dbbbc9d6, $acbcf940, $32d86ce3, 36 | $45df5c75, $dcd60dcf, $abd13d59, $26d930ac, $51de003a, 37 | $c8d75180, $bfd06116, $21b4f4b5, $56b3c423, $cfba9599, 38 | $b8bda50f, $2802b89e, $5f058808, $c60cd9b2, $b10be924, 39 | $2f6f7c87, $58684c11, $c1611dab, $b6662d3d, $76dc4190, 40 | $01db7106, $98d220bc, $efd5102a, $71b18589, $06b6b51f, 41 | $9fbfe4a5, $e8b8d433, $7807c9a2, $0f00f934, $9609a88e, 42 | $e10e9818, $7f6a0dbb, $086d3d2d, $91646c97, $e6635c01, 43 | $6b6b51f4, $1c6c6162, $856530d8, $f262004e, $6c0695ed, 44 | $1b01a57b, $8208f4c1, $f50fc457, $65b0d9c6, $12b7e950, 45 | $8bbeb8ea, $fcb9887c, $62dd1ddf, $15da2d49, $8cd37cf3, 46 | $fbd44c65, $4db26158, $3ab551ce, $a3bc0074, $d4bb30e2, 47 | $4adfa541, $3dd895d7, $a4d1c46d, $d3d6f4fb, $4369e96a, 48 | $346ed9fc, $ad678846, $da60b8d0, $44042d73, $33031de5, 49 | $aa0a4c5f, $dd0d7cc9, $5005713c, $270241aa, $be0b1010, 50 | $c90c2086, $5768b525, $206f85b3, $b966d409, $ce61e49f, 51 | $5edef90e, $29d9c998, $b0d09822, $c7d7a8b4, $59b33d17, 52 | $2eb40d81, $b7bd5c3b, $c0ba6cad, $edb88320, $9abfb3b6, 53 | $03b6e20c, $74b1d29a, $ead54739, $9dd277af, $04db2615, 54 | $73dc1683, $e3630b12, $94643b84, $0d6d6a3e, $7a6a5aa8, 55 | $e40ecf0b, $9309ff9d, $0a00ae27, $7d079eb1, $f00f9344, 56 | $8708a3d2, $1e01f268, $6906c2fe, $f762575d, $806567cb, 57 | $196c3671, $6e6b06e7, $fed41b76, $89d32be0, $10da7a5a, 58 | $67dd4acc, $f9b9df6f, $8ebeeff9, $17b7be43, $60b08ed5, 59 | $d6d6a3e8, $a1d1937e, $38d8c2c4, $4fdff252, $d1bb67f1, 60 | $a6bc5767, $3fb506dd, $48b2364b, $d80d2bda, $af0a1b4c, 61 | $36034af6, $41047a60, $df60efc3, $a867df55, $316e8eef, 62 | $4669be79, $cb61b38c, $bc66831a, $256fd2a0, $5268e236, 63 | $cc0c7795, $bb0b4703, $220216b9, $5505262f, $c5ba3bbe, 64 | $b2bd0b28, $2bb45a92, $5cb36a04, $c2d7ffa7, $b5d0cf31, 65 | $2cd99e8b, $5bdeae1d, $9b64c2b0, $ec63f226, $756aa39c, 66 | $026d930a, $9c0906a9, $eb0e363f, $72076785, $05005713, 67 | $95bf4a82, $e2b87a14, $7bb12bae, $0cb61b38, $92d28e9b, 68 | $e5d5be0d, $7cdcefb7, $0bdbdf21, $86d3d2d4, $f1d4e242, 69 | $68ddb3f8, $1fda836e, $81be16cd, $f6b9265b, $6fb077e1, 70 | $18b74777, $88085ae6, $ff0f6a70, $66063bca, $11010b5c, 71 | $8f659eff, $f862ae69, $616bffd3, $166ccf45, $a00ae278, 72 | $d70dd2ee, $4e048354, $3903b3c2, $a7672661, $d06016f7, 73 | $4969474d, $3e6e77db, $aed16a4a, $d9d65adc, $40df0b66, 74 | $37d83bf0, $a9bcae53, $debb9ec5, $47b2cf7f, $30b5ffe9, 75 | $bdbdf21c, $cabac28a, $53b39330, $24b4a3a6, $bad03605, 76 | $cdd70693, $54de5729, $23d967bf, $b3667a2e, $c4614ab8, 77 | $5d681b02, $2a6f2b94, $b40bbe37, $c30c8ea1, $5a05df1b, 78 | $2d02ef8d 79 | ) ; 80 | 81 | implementation 82 | 83 | uses 84 | SysUtils; 85 | 86 | function CRC32(Buffer : pointer; Size : integer; Start:cardinal) : cardinal; 87 | var 88 | I : integer; 89 | begin 90 | Result := Start; 91 | for I := 0 to Size - 1 do 92 | Result := CRC32Table[(Result xor Cardinal(PByteArray(Buffer)[I])) and $FF] xor (Result shr 8); 93 | end; 94 | 95 | 96 | function CRC32(Buffer : pointer; Size : integer) : cardinal; 97 | begin 98 | Result := CRC32(Buffer,Size,0); 99 | end; 100 | 101 | 102 | end. 103 | -------------------------------------------------------------------------------- /Sources/SBCamellia.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcamellia.pas' rev: 21.00 6 | 7 | #ifndef SbcamelliaHPP 8 | #define SbcamelliaHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | 23 | //-- user supplied ----------------------------------------------------------- 24 | 25 | namespace Sbcamellia 26 | { 27 | //-- type declarations ------------------------------------------------------- 28 | typedef StaticArray TCmInt64; 29 | 30 | typedef StaticArray TCmInt128; 31 | 32 | typedef StaticArray TSBCamelliaBuffer; 33 | 34 | typedef TSBCamelliaBuffer *PSBCamelliaBuffer; 35 | 36 | typedef Sbtypes::ByteArray TSBCamelliaKey; 37 | 38 | struct TSBCamelliaExpandedKey 39 | { 40 | 41 | public: 42 | StaticArray, 24> K; 43 | StaticArray, 6> KE; 44 | StaticArray, 4> KW; 45 | }; 46 | 47 | 48 | //-- var, const, procedure --------------------------------------------------- 49 | extern PACKAGE void __fastcall EncryptBlock(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, const TSBCamelliaExpandedKey &Key, bool LongKey); 50 | extern PACKAGE bool __fastcall ExpandKeyForEncryption(const Sbtypes::ByteArray Key, /* out */ TSBCamelliaExpandedKey &EKey); 51 | extern PACKAGE bool __fastcall ExpandKeyForDecryption(const Sbtypes::ByteArray Key, /* out */ TSBCamelliaExpandedKey &EKey); 52 | 53 | } /* namespace Sbcamellia */ 54 | using namespace Sbcamellia; 55 | #pragma pack(pop) 56 | #pragma option pop 57 | 58 | #pragma delphiheader end. 59 | //-- end unit ---------------------------------------------------------------- 60 | #endif // SbcamelliaHPP 61 | -------------------------------------------------------------------------------- /Sources/SBCertStorageEditor.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Sources/SBCertStorageEditor.dfm -------------------------------------------------------------------------------- /Sources/SBChSCJKConsts.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SBChSUnicode.inc} 11 | 12 | unit SBChSCJKConsts; 13 | 14 | interface 15 | 16 | implementation 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /Sources/SBChSConvCharsets.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbchsconvcharsets.pas' rev: 21.00 6 | 7 | #ifndef SbchsconvcharsetsHPP 8 | #define SbchsconvcharsetsHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbchsconvcharsets 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | //-- var, const, procedure --------------------------------------------------- 26 | 27 | } /* namespace Sbchsconvcharsets */ 28 | using namespace Sbchsconvcharsets; 29 | #pragma pack(pop) 30 | #pragma option pop 31 | 32 | #pragma delphiheader end. 33 | //-- end unit ---------------------------------------------------------------- 34 | #endif // SbchsconvcharsetsHPP 35 | -------------------------------------------------------------------------------- /Sources/SBChSConvCharsets.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SBChSUnicode.inc} 11 | 12 | unit SBChSConvCharsets; 13 | 14 | interface 15 | 16 | {$define _USE_CHARSETS_EXPLICITLY_} 17 | 18 | {$ifdef SB_WINRT} 19 | {$define _USE_CHARSETS_EXPLICITLY_} 20 | {$endif} 21 | 22 | {$ifdef NET_CF} 23 | {$define _USE_CHARSETS_EXPLICITLY_} 24 | {$endif} 25 | 26 | uses 27 | {$ifndef SB_REDUCED_CHARSETS} 28 | {$ifdef _USE_CHARSETS_EXPLICITLY_} 29 | csISO_8859_2, 30 | csISO_8859_3, 31 | csISO_8859_4, 32 | csISO_8859_5, 33 | csISO_8859_6, 34 | csISO_8859_7, 35 | csISO_8859_8, 36 | csISO_8859_8i, 37 | csISO_8859_9, 38 | csISO_8859_10, 39 | csISO_8859_11, 40 | csISO_8859_13, 41 | csISO_8859_14, 42 | csISO_8859_15, 43 | csISO_8859_16, 44 | 45 | csCP1250, 46 | csCP1251, 47 | csCP1252, 48 | csCP1253, 49 | csCP1254, 50 | csCP1255, 51 | csCP1256, 52 | csCP1257, 53 | csCP1258, 54 | 55 | csCP437, 56 | csCP500, 57 | csCP737, 58 | csCP775, 59 | csCP850, 60 | csCP852, 61 | csCP857, 62 | csCP861, 63 | csCP862, 64 | csCP866, 65 | csCP869, 66 | csCP874, 67 | //csCP950Data, 68 | 69 | csCP037, 70 | csCP424, 71 | csCP853, 72 | csCP855, 73 | csCP856, 74 | csCP860, 75 | csCP863, 76 | csCP864, 77 | csCP865, 78 | csCP875, 79 | csCP1006, 80 | csCP1131, 81 | csCP1133, 82 | 83 | csKOI8R, 84 | csKOI8U, 85 | csKOI8RU, 86 | csKOI8T, 87 | csBigFive, 88 | csGeorgianAcademy, 89 | csGeorgianPS, 90 | csGEOSTD8, 91 | csARMSCII_8, 92 | csVISCII, 93 | csAtariST, 94 | csHPRoman8, 95 | csNextStep, 96 | 97 | csMacCeltic, 98 | csMacCentralEuropean, 99 | csMacCroatian, 100 | csMacCyrillic, 101 | csMacGaelic, 102 | csMacGreek, 103 | csMacHebrew, 104 | csMacIcelandic, 105 | csMacRoman, 106 | csMacRomanian, 107 | csMacThai, 108 | csMacTurkish, 109 | {$endif} 110 | {$endif} 111 | SBChSConv, 112 | 113 | SBChSConvBase 114 | ; 115 | 116 | 117 | 118 | implementation 119 | 120 | 121 | end. 122 | -------------------------------------------------------------------------------- /Sources/SBChSConvConsts.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SBChSUnicode.inc} 11 | 12 | unit SBChSConvConsts; 13 | 14 | interface 15 | 16 | 17 | resourcestring 18 | SEncodingError = '%s ecoding error: %s'; 19 | SDecodingError = '%s decoding error: %s'; 20 | 21 | SIllegalCharacter = 'Illegal character'; 22 | 23 | SUnicodeCategory = 'Unicode'; 24 | 25 | SArabicCategory = 'Arabic'; 26 | SBalticCategory = 'Baltic'; 27 | SCelticCategory = 'Celtic'; 28 | SCyrillicCategory = 'Cyrillic'; 29 | SGreekCategory = 'Greek'; 30 | SHebrewCategory = 'Hebrew'; 31 | SNordicCategory = 'Nordic'; 32 | SIcelandicCategory = 'Icelandic'; 33 | STurkishCategory = 'Turkish'; 34 | SRomanianCategory = 'Romanian'; 35 | SVietnameseCategory = 'Vietnamese'; 36 | SGeorgianCategory = 'Georgian'; 37 | SArmenianCategory = 'Armenian'; 38 | STajikCategory = 'Tajik'; 39 | SThaiCategory = 'Thai'; 40 | 41 | SUSCategory = 'United States'; 42 | 43 | SCentralEuropeanCategory = 'Central European'; 44 | SSouthEuropeanCategory = 'South European'; 45 | SWesternEuropeanCategory = 'Western European'; 46 | 47 | SChineseCategory = 'Chinese'; 48 | SJapaneseCategory = 'Japanese'; 49 | SKoreanCategory = 'Korean'; 50 | 51 | SUTF32 = 'Unicode (UTF-32)'; 52 | SUTF32BE = 'Unicode (UTF-32 Big Endian)'; 53 | SUTF16 = 'Unicode (UTF-16)'; 54 | SUTF16BE = 'Unicode (UTF-16 Big Endian)'; 55 | SUTF8 = 'Unicode (UTF-8)'; 56 | SUTF7 = 'Unicode (UTF-7)'; 57 | 58 | SUS_ASCII = 'US-ASCII (7 bit)'; 59 | SISO_8859_1 = 'Western European (ISO-8859-1)'; 60 | 61 | implementation 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /Sources/SBChSUnicode.inc: -------------------------------------------------------------------------------- 1 | {$I SecBbox.inc} 2 | 3 | {$UNDEF _MAKE_RESOURCES_} 4 | {$UNDEF _USED_RESOURCES_} 5 | {$UNDEF _USES_RESOURCES_} 6 | {$UNDEF _RESNET_SERIALIZABLE_} 7 | {$UNDEF _STRING_RESOURCES_} 8 | 9 | {$IFDEF SB_NET} 10 | {$DEFINE _USED_RESOURCES_} // Include Charsets Resources. 11 | {$IFDEF NET_CF} 12 | {.$DEFINE _STRING_RESOURCES_} 13 | {$ENDIF} 14 | {$IFDEF SB_WINRT} 15 | {$DEFINE _STRING_RESOURCES_} 16 | {$ENDIF} 17 | // .Net Serialization option: 18 | {.$DEFINE _RESNET_SERIALIZABLE_} // Not recommended it option (Resources are dependent from current assembly (project name, etc) ). 19 | {$ELSE} 20 | {.$DEFINE _USED_RESOURCES_} // Include Charsets Resources. Not recommended it options for not .Net platform. 21 | {$ENDIF} 22 | 23 | {$IFDEF SB_JAVA} 24 | {$DEFINE _USED_RESOURCES_} 25 | //{$DEFINE _MAKE_RESOURCES_} 26 | {$ENDIF} 27 | 28 | // Developer Options begin: 29 | // *********************** 30 | {$IFNDEF _USED_RESOURCES_} 31 | 32 | {.$DEFINE _MAKE_RESOURCES_} 33 | (* 34 | 35 | // Delphi 4,5,6,7 36 | // For generation Resource File ".res" need call procedure: "SerializeRegisteredCharsets()" 37 | --- compile resource bath file "Compile_rc.bat" --- 38 | @echo off 39 | call make_prj.bat 7 ? 40 | BRCC32.EXE SecureBlackbox.Unicode.rc 41 | if %ERRORLEVEL% == 0 goto L_OK 42 | echo ERROR: (%ERRORLEVEL%) 43 | goto L_EXIT 44 | :L_OK 45 | echo Done. 46 | :L_EXIT 47 | exit 48 | --------------------------------------------------- 49 | >Compile_rc.bat 50 | 51 | // .Net: 52 | // 53 | // For generation XML Resource File ".resx" need call procedure: "SerializeRegisteredCharsets()" 54 | -- compile resource bath file "Compile_ResX.bat" -- 55 | @echo off 56 | set DOT_NET_SDK_ROOT_DIR=H:\PROGRAMs\DEV\Miscrosoft\VS.NET.2003\SDK\v1.1 57 | set path=%DOT_NET_SDK_ROOT_DIR%\Bin;%path% 58 | 59 | resGen.exe EldoS.SecureBlackbox.Unicode.struct.resx 60 | --------------------------------------------------- 61 | 62 | >Compile_ResX.bat 63 | 64 | *) 65 | {$UNDEF _MAKE_RESOURCES_BINARY_} 66 | {$IFDEF _MAKE_RESOURCES_} 67 | // todo: do not correctly generated binary resource 68 | {.$DEFINE _MAKE_RESOURCES_BINARY_} // For generation binary resource ".resources" 69 | {$ENDIF} 70 | 71 | {$ENDIF IFNDEF _USED_RESOURCES_} 72 | // Developer Options end. 73 | // *********************** 74 | 75 | {$ifdef SB_CHARSET_BUILDER} 76 | {$UNDEF _USED_RESOURCES_} 77 | {$define _MAKE_RESOURCES_} 78 | {$endif} 79 | 80 | {$ifdef _MAKE_RESOURCES_} 81 | {$ifdef NET_CF_RESOURCES} 82 | {$define _STRING_RESOURCES_} 83 | {$endif} 84 | {$endif} 85 | 86 | {$IFDEF _MAKE_RESOURCES_} 87 | {$DEFINE _USES_RESOURCES_} 88 | {$ENDIF} 89 | {$IFDEF _USED_RESOURCES_} 90 | {$DEFINE _USES_RESOURCES_} 91 | {$ENDIF} 92 | 93 | {$ifdef SB_REDUCED_CHARSETS} 94 | {$undef _USED_RESOURCES_} 95 | {$endif} 96 | 97 | {$ifndef SB_JAVA} 98 | {$ifndef SB_NET} 99 | {$J-,B-} 100 | {$endif} 101 | {$endif} -------------------------------------------------------------------------------- /Sources/SBChSUnicode.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SBChSUnicode.inc} 11 | 12 | unit SBChSUnicode; 13 | 14 | interface 15 | 16 | 17 | uses 18 | Classes, 19 | SBTypes, 20 | SBUtils, 21 | SBConstants; 22 | 23 | type 24 | TPlCharType = (ctOther, ctLetterUpper, ctLetterLower, ctLetterTitle, 25 | ctLetterOther, ctNumber, ctPunctuation, ctSpace, ctControl, ctMark); 26 | 27 | procedure WideUpperCase(var C: WideChar); overload; 28 | function WideUpperCase(const S: UnicodeString): UnicodeString; overload; 29 | 30 | procedure WideLowerCase(var C: WideChar); overload; 31 | function WideLowerCase(const S: UnicodeString): UnicodeString; overload; 32 | 33 | procedure WideTitleCase(var C: WideChar); overload; 34 | 35 | function WideTitleCase(const S: UnicodeString): UnicodeString; overload; 36 | 37 | function GetCharType(C: WideChar): TPlCharType; 38 | (* 39 | type 40 | TWideStringStream = class(TMemoryStream) 41 | protected 42 | function GetDataString: UnicodeString; 43 | public 44 | constructor Create(const aString: UnicodeString); 45 | 46 | property DataString: UnicodeString read GetDataString; 47 | end; 48 | *) 49 | 50 | implementation 51 | 52 | 53 | 54 | 55 | 56 | {$I SBChSUnicodeData.inc} 57 | 58 | procedure WideUpperCase(var C: WideChar); overload; 59 | var 60 | SubArray: PPlCaseSubArray; 61 | begin 62 | SubArray := ToUpper[Word(C) shr CaseShift]; 63 | if SubArray <> nil then 64 | C := SubArray^[Word(C) and CaseMask]; 65 | end; 66 | 67 | function WideUpperCase(const S: UnicodeString): UnicodeString; overload; 68 | var 69 | I, L: Integer; 70 | begin 71 | L := Length(S); 72 | Result := S; 73 | for I := StringStartOffset to L - StringStartInvOffset do 74 | WideUpperCase(Result[I]); 75 | end; 76 | 77 | procedure WideLowerCase(var C: WideChar); overload; 78 | var 79 | SubArray: PPlCaseSubArray; 80 | begin 81 | SubArray := ToLower[Word(C) shr CaseShift]; 82 | if SubArray <> nil then 83 | C := SubArray^[Word(C) and CaseMask]; 84 | end; 85 | 86 | function WideLowerCase(const S: UnicodeString): UnicodeString; overload; 87 | var 88 | I, L: Integer; 89 | begin 90 | L := Length(S); 91 | Result := S; 92 | for I := StringStartOffset to L - StringStartInvOffset do 93 | WideLowerCase(Result[I]); 94 | end; 95 | 96 | procedure WideTitleCase(var C: WideChar); overload; 97 | var 98 | SubArray: PPlCaseSubArray; 99 | begin 100 | SubArray := ToTitle[Word(C) shr CaseShift]; 101 | if SubArray <> nil then 102 | C := SubArray^[Word(C) and CaseMask]; 103 | end; 104 | 105 | function WideTitleCase(const S: UnicodeString): UnicodeString; overload; 106 | var 107 | I, L: Integer; 108 | begin 109 | L := Length(S); 110 | Result := S; 111 | for I := StringStartOffset to L - StringStartInvOffset do 112 | WideTitleCase(Result[I]); 113 | end; 114 | 115 | function GetCharType(C: WideChar): TPlCharType; 116 | var 117 | Item: PPlTypeArrayItem; 118 | begin 119 | Item := @CharTypes[Word(C) shr TypeShift]; 120 | if Item^.SubArray = nil then 121 | Result := Item^.RangeType 122 | else 123 | Result := TPlCharType( 124 | (Item^.SubArray[(Word(C) and TypeMask) shr 3] shr 125 | ((Word(C) and 7) * 4) and 15) 126 | ); 127 | end; 128 | 129 | (* 130 | { TWideStringStream } 131 | 132 | constructor TWideStringStream.Create(const aString: UnicodeString); 133 | var 134 | StrLen: {$ifdef SB_CPU64}{$ifdef FPC}Int64{$else}Longint{$endif}{$else}Integer{$endif}; 135 | begin 136 | inherited Create; 137 | StrLen := Length(aString); 138 | if StrLen > 0 then 139 | begin 140 | StrLen := StrLen * SizeOf(WideChar); 141 | Realloc(StrLen); 142 | SBMove(Pointer(aString)^, Memory^, StrLen); 143 | end; 144 | end; 145 | 146 | function TWideStringStream.GetDataString: UnicodeString; 147 | var 148 | StrLen: Integer; 149 | begin 150 | StrLen := (Size + (SizeOf(WideChar) - 1)) div SizeOf(WideChar); 151 | SetLength(Result, StrLen); 152 | if StrLen > 0 then 153 | SBMove(Memory^, Pointer(Result)^, StrLen * SizeOf(WideChar)); 154 | end; 155 | *) 156 | 157 | end. 158 | -------------------------------------------------------------------------------- /Sources/SBCryptoProvDefault.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcryptoprovdefault.pas' rev: 21.00 6 | 7 | #ifndef SbcryptoprovdefaultHPP 8 | #define SbcryptoprovdefaultHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbcryptoprovdefault 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | //-- var, const, procedure --------------------------------------------------- 28 | extern PACKAGE Sbcryptoprov::TElCustomCryptoProvider* __fastcall DefaultCryptoProvider(void); 29 | extern PACKAGE void __fastcall SetDefaultCryptoProviderType(Sbcryptoprov::TElCustomCryptoProviderClass Value); 30 | 31 | } /* namespace Sbcryptoprovdefault */ 32 | using namespace Sbcryptoprovdefault; 33 | #pragma pack(pop) 34 | #pragma option pop 35 | 36 | #pragma delphiheader end. 37 | //-- end unit ---------------------------------------------------------------- 38 | #endif // SbcryptoprovdefaultHPP 39 | -------------------------------------------------------------------------------- /Sources/SBCryptoProvDefault.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SecBbox.inc} 11 | 12 | unit SBCryptoProvDefault; 13 | 14 | interface 15 | 16 | uses 17 | SBCryptoProv, 18 | SBCryptoProvBuiltIn, 19 | //SBCryptoProvDLL, 20 | SBTypes, 21 | SBUtils; 22 | 23 | // TODO: 24 | // * Redesign the code to make it call Manager->GetDefaultProvider() 25 | // * Review creation and registration of pre-defined providers 26 | // (we need to register exactly those objects that are created in the 27 | // corresponding units). We may try to redirect the corresponding functions 28 | // (e.g. Win32CryptoProviders) to the cryptoprovidermanager. 29 | 30 | function DefaultCryptoProvider : TElCustomCryptoProvider; 31 | //function CreateDefaultCryptoProviderInstance : TElCustomCryptoProvider; {$ifdef SB_NET}public;{$endif} 32 | procedure SetDefaultCryptoProviderType(Value: TElCustomCryptoProviderClass); 33 | 34 | implementation 35 | 36 | uses 37 | SBCryptoProvManager; 38 | 39 | //var 40 | // DefCryptoProv : TElCustomCryptoProvider {$ifndef SB_NET}={$else}:={$endif} nil; 41 | // DefCryptoProvType : TElCustomCryptoProviderClass {$ifndef SB_NET}={$else}:={$endif} TElBuiltInCryptoProvider; 42 | 43 | function DefaultCryptoProvider : TElCustomCryptoProvider; 44 | begin 45 | Result := DefaultCryptoProviderManager.DefaultCryptoProvider; 46 | (*if DefCryptoProv = nil then 47 | DefCryptoProv := {$ifndef SB_NET}DefCryptoProvType.Create{$else}DefCryptoProvType.New{$endif}({$ifdef SB_VCL}nil{$endif}); 48 | result := DefCryptoProv; 49 | *) 50 | //if DefCryptoProv = nil then 51 | //begin 52 | // DefCryptoProv := TElDLLCryptoProvider.Create({$ifdef SB_VCL}nil{$endif}); 53 | // TElDLLCryptoProvider(DefCryptoProv).DllName := 'SBCryptoProvLib.dll'; 54 | //end; 55 | //Result := DefCryptoProv; 56 | end; 57 | 58 | //function CreateDefaultCryptoProviderInstance : TElCustomCryptoProvider; 59 | //begin 60 | //Result := TElBuiltinCryptoProvider.Create({$ifdef SB_VCL}nil{$endif}); 61 | //end; 62 | 63 | procedure SetDefaultCryptoProviderType(Value : TElCustomCryptoProviderClass); 64 | begin 65 | //DefCryptoProvType := Value; 66 | //DefCryptoProv := nil; 67 | DefaultCryptoProviderManager.SetDefaultCryptoProviderType(Value); 68 | end; 69 | 70 | initialization 71 | 72 | finalization 73 | //if DefCryptoProv <> nil then 74 | // FreeAndNil(DefCryptoProv); 75 | 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /Sources/SBCryptoProvUtils.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcryptoprovutils.pas' rev: 21.00 6 | 7 | #ifndef SbcryptoprovutilsHPP 8 | #define SbcryptoprovutilsHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | 25 | //-- user supplied ----------------------------------------------------------- 26 | 27 | namespace Sbcryptoprovutils 28 | { 29 | //-- type declarations ------------------------------------------------------- 30 | //-- var, const, procedure --------------------------------------------------- 31 | extern PACKAGE bool __fastcall CryptoProvGetBoolParam(Sbrdn::TElRelativeDistinguishedName* Params, const Sbtypes::ByteArray Name, bool Default); 32 | extern PACKAGE int __fastcall GetIntegerPropFromBuffer(const Sbtypes::ByteArray Value, int Default = 0x0); 33 | extern PACKAGE __int64 __fastcall GetInt64PropFromBuffer(const Sbtypes::ByteArray Value, int Default = 0x0); 34 | extern PACKAGE Sbtypes::ByteArray __fastcall GetBufferFromInteger(int Value); 35 | extern PACKAGE Sbtypes::ByteArray __fastcall GetBufferFromInt64(__int64 Value); 36 | extern PACKAGE bool __fastcall GetBoolFromBuffer(const Sbtypes::ByteArray Value, bool Default = false); 37 | extern PACKAGE Sbtypes::ByteArray __fastcall GetBufferFromBool(bool Value); 38 | extern PACKAGE void * __fastcall GetPointerFromBuffer(const Sbtypes::ByteArray Value); 39 | extern PACKAGE Sbtypes::ByteArray __fastcall GetBufferFromPointer(void * Value); 40 | extern PACKAGE bool __fastcall ExtractSymmetricCipherParams(const Sbtypes::ByteArray AlgOID, const Sbtypes::ByteArray AlgParams, int &KeyLen, Sbtypes::ByteArray &IV); 41 | extern PACKAGE Sbtypes::ByteArray __fastcall SerializeParams(Sbrdn::TElRelativeDistinguishedName* Params); 42 | extern PACKAGE Sbrdn::TElRelativeDistinguishedName* __fastcall UnserializeParams(void * Buffer, int Size); 43 | extern PACKAGE bool __fastcall IsKeyDrivenOperation(int OpType); 44 | extern PACKAGE bool __fastcall IsSecretKeyOperation(int OpType); 45 | extern PACKAGE bool __fastcall IsAlgorithmIndependentOperation(int OpType); 46 | 47 | } /* namespace Sbcryptoprovutils */ 48 | using namespace Sbcryptoprovutils; 49 | #pragma pack(pop) 50 | #pragma option pop 51 | 52 | #pragma delphiheader end. 53 | //-- end unit ---------------------------------------------------------------- 54 | #endif // SbcryptoprovutilsHPP 55 | -------------------------------------------------------------------------------- /Sources/SBCustomCrypto.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbcustomcrypto.pas' rev: 21.00 6 | 7 | #ifndef SbcustomcryptoHPP 8 | #define SbcustomcryptoHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbcustomcrypto 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS TElKeyMaterial; 30 | class PASCALIMPLEMENTATION TElKeyMaterial : public System::TObject 31 | { 32 | typedef System::TObject inherited; 33 | 34 | protected: 35 | Sbcryptoprov::TElCustomCryptoKey* FKey; 36 | virtual bool __fastcall GetValid(void); 37 | virtual int __fastcall GetBits(void); 38 | virtual bool __fastcall GetExportable(void); 39 | virtual int __fastcall GetAlgorithm(void); 40 | Sbtypes::ByteArray __fastcall GetKeyID(void); 41 | void __fastcall SetKeyID(const Sbtypes::ByteArray Value); 42 | Sbtypes::ByteArray __fastcall GetKeySubject(void); 43 | void __fastcall SetKeySubject(const Sbtypes::ByteArray Value); 44 | System::UnicodeString __fastcall GetProviderName(void); 45 | void __fastcall SetProviderName(const System::UnicodeString Value); 46 | 47 | public: 48 | __fastcall TElKeyMaterial(void); 49 | __fastcall virtual ~TElKeyMaterial(void); 50 | virtual void __fastcall Generate(int Bits); 51 | virtual void __fastcall Save(Classes::TStream* Stream); 52 | virtual void __fastcall Load(Classes::TStream* Stream, int Count = 0x0); 53 | virtual void __fastcall Assign(TElKeyMaterial* Source); 54 | HIDESBASE virtual bool __fastcall Equals(TElKeyMaterial* Source, bool PublicOnly)/* overload */; 55 | virtual bool __fastcall Equals(System::TObject* Obj)/* overload */; 56 | virtual TElKeyMaterial* __fastcall Clone(void); 57 | virtual void __fastcall AssignCryptoKey(Sbcryptoprov::TElCustomCryptoKey* Key); 58 | virtual void __fastcall Persistentiate(void); 59 | __property bool Exportable = {read=GetExportable, nodefault}; 60 | __property bool Valid = {read=GetValid, nodefault}; 61 | __property int Bits = {read=GetBits, nodefault}; 62 | __property Sbcryptoprov::TElCustomCryptoKey* Key = {read=FKey}; 63 | __property int Algorithm = {read=GetAlgorithm, nodefault}; 64 | __property Sbtypes::ByteArray KeyID = {read=GetKeyID, write=SetKeyID}; 65 | __property Sbtypes::ByteArray KeySubject = {read=GetKeySubject, write=SetKeySubject}; 66 | __property System::UnicodeString ProviderName = {read=GetProviderName, write=SetProviderName}; 67 | }; 68 | 69 | typedef TElKeyMaterial ElKeyMaterial 70 | class DELPHICLASS TElCustomCrypto; 71 | class PASCALIMPLEMENTATION TElCustomCrypto : public System::TObject 72 | { 73 | typedef System::TObject inherited; 74 | 75 | public: 76 | /* TObject.Create */ inline __fastcall TElCustomCrypto(void) : System::TObject() { } 77 | /* TObject.Destroy */ inline __fastcall virtual ~TElCustomCrypto(void) { } 78 | 79 | }; 80 | 81 | typedef TElCustomCrypto ElCustomCrypto 82 | //-- var, const, procedure --------------------------------------------------- 83 | 84 | } /* namespace Sbcustomcrypto */ 85 | using namespace Sbcustomcrypto; 86 | #pragma pack(pop) 87 | #pragma option pop 88 | 89 | #pragma delphiheader end. 90 | //-- end unit ---------------------------------------------------------------- 91 | #endif // SbcustomcryptoHPP 92 | -------------------------------------------------------------------------------- /Sources/SBDES.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbdes.pas' rev: 21.00 6 | 7 | #ifndef SbdesHPP 8 | #define SbdesHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbdes 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef StaticArray TDESExpandedKey; 28 | 29 | //-- var, const, procedure --------------------------------------------------- 30 | static const ShortInt TDESBufferSize = 0x8; 31 | static const ShortInt TDESKeySize = 0x8; 32 | static const Word TDESExpandedKeySize = 0x300; 33 | static const ShortInt T3DESBufferSize = 0x8; 34 | static const ShortInt T3DESKeySize = 0x18; 35 | static const Word T3DESExpandedKeySize = 0x900; 36 | extern PACKAGE void __fastcall ExpandKeyForEncryption(const Sbtypes::ByteArray Key, unsigned *ExpandedKey); 37 | extern PACKAGE void __fastcall ExpandKeyForDecryption(const Sbtypes::ByteArray Key, unsigned *ExpandedKey); 38 | extern PACKAGE void __fastcall Encrypt(unsigned &B0, unsigned &B1, unsigned const *ExpandedKey); 39 | extern PACKAGE void __fastcall EncryptEDE(unsigned &B0, unsigned &B1, unsigned const *Key1, unsigned const *Key2, unsigned const *Key3); 40 | 41 | } /* namespace Sbdes */ 42 | using namespace Sbdes; 43 | #pragma pack(pop) 44 | #pragma option pop 45 | 46 | #pragma delphiheader end. 47 | //-- end unit ---------------------------------------------------------------- 48 | #endif // SbdesHPP 49 | -------------------------------------------------------------------------------- /Sources/SBDSA.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbdsa.pas' rev: 21.00 6 | 7 | #ifndef SbdsaHPP 8 | #define SbdsaHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbdsa 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | //-- var, const, procedure --------------------------------------------------- 30 | extern PACKAGE bool __fastcall ValidateSignature(void * Hash, int HashSize, void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * Y, int YSize, void * R, int RSize, void * S, int SSize); 31 | extern PACKAGE bool __fastcall ExternalGenerationSupported(void); 32 | extern PACKAGE bool __fastcall Generate(int Bits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize)/* overload */; 33 | extern PACKAGE bool __fastcall ExternalGenerate(int Bits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize)/* overload */; 34 | extern PACKAGE bool __fastcall GenerateEx(int PBits, int QBits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 35 | extern PACKAGE bool __fastcall ExternalGenerateEx(int PBits, int QBits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 36 | extern PACKAGE bool __fastcall Generate(int Bits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize, void * PrivateKeyBlob, int &PrivateKeyBlobSize, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 37 | extern PACKAGE bool __fastcall ExternalGenerate(int Bits, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize, void * PrivateKeyBlob, int &PrivateKeyBlobSize, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 38 | extern PACKAGE bool __fastcall SignEx(void * Hash, int HashSize, void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * X, int XSize, void * R, int &RSize, void * S, int &SSize); 39 | extern PACKAGE bool __fastcall Sign(void * Hash, int HashSize, void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * X, int XSize, void * R, int &RSize, void * S, int &SSize); 40 | extern PACKAGE bool __fastcall DecodePrivateKey(void * Buffer, int Size, void * P, int &PSize, void * Q, int &QSize, void * G, int &GSize, void * Y, int &YSize, void * X, int &XSize); 41 | extern PACKAGE bool __fastcall EncodePrivateKey(void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * Y, int YSize, void * X, int XSize, void * OutBuffer, int &OutSize); 42 | extern PACKAGE bool __fastcall DecodeSignature(void * Blob, int Size, void * R, int &RSize, void * S, int &SSize); 43 | extern PACKAGE bool __fastcall EncodeSignature(void * R, int RSize, void * S, int SSize, void * Blob, int &BlobSize); 44 | extern PACKAGE bool __fastcall IsValidKey(void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * Y, int YSize, void * X, int XSize, bool Secret, bool StrictMode = false); 45 | 46 | } /* namespace Sbdsa */ 47 | using namespace Sbdsa; 48 | #pragma pack(pop) 49 | #pragma option pop 50 | 51 | #pragma delphiheader end. 52 | //-- end unit ---------------------------------------------------------------- 53 | #endif // SbdsaHPP 54 | -------------------------------------------------------------------------------- /Sources/SBECDSA.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbecdsa.pas' rev: 21.00 6 | 7 | #ifndef SbecdsaHPP 8 | #define SbecdsaHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | #include // Pascal unit 25 | 26 | //-- user supplied ----------------------------------------------------------- 27 | 28 | namespace Sbecdsa 29 | { 30 | //-- type declarations ------------------------------------------------------- 31 | //-- var, const, procedure --------------------------------------------------- 32 | extern PACKAGE bool __fastcall ExternalGenerationSupported(void); 33 | extern PACKAGE bool __fastcall GenerateEx(void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int FldType, int Fld, void * D, int &DSize, void * Qx, int &QxSize, void * Qy, int &QySize); 34 | extern PACKAGE bool __fastcall ExternalGenerateEx(void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int CurveID, const Sbtypes::ByteArray CurveOID, int FldType, int Fld, void * D, int &DSize, void * Qx, int &QxSize, void * Qy, int &QySize); 35 | extern PACKAGE bool __fastcall SignEx(void * hash, int hashSize, void * d, int dSize, void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int FldType, int Fld, int Flag, void * R, int &RSize, void * S, int &SSize); 36 | extern PACKAGE bool __fastcall VerifyEx(void * hash, int hashSize, void * Qx, int QxSize, void * Qy, int QySize, void * R, int RSize, void * S, int SSize, void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int FldType, int Fld, int Flags); 37 | 38 | } /* namespace Sbecdsa */ 39 | using namespace Sbecdsa; 40 | #pragma pack(pop) 41 | #pragma option pop 42 | 43 | #pragma delphiheader end. 44 | //-- end unit ---------------------------------------------------------------- 45 | #endif // SbecdsaHPP 46 | -------------------------------------------------------------------------------- /Sources/SBElGamal.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbelgamal.pas' rev: 21.00 6 | 7 | #ifndef SbelgamalHPP 8 | #define SbelgamalHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbelgamal 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | //-- var, const, procedure --------------------------------------------------- 30 | extern PACKAGE bool __fastcall ExternalGenerationSupported(void); 31 | extern PACKAGE bool __fastcall Generate(int Bits, Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt X, Sbmath::PLInt Y, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 32 | extern PACKAGE bool __fastcall ExternalGenerate(int Bits, Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt X, Sbmath::PLInt Y, Sbmath::TSBMathProgressFunc ProgressFunc = 0x0, void * Data = (void *)(0x0))/* overload */; 33 | extern PACKAGE bool __fastcall Encrypt(Sbmath::PLInt Src, Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt Y, Sbmath::PLInt A, Sbmath::PLInt B); 34 | extern PACKAGE bool __fastcall Decrypt(Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt X, Sbmath::PLInt A, Sbmath::PLInt B, Sbmath::PLInt Dest); 35 | extern PACKAGE bool __fastcall Sign(Sbmath::PLInt Src, Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt X, Sbmath::PLInt A, Sbmath::PLInt B); 36 | extern PACKAGE bool __fastcall Verify(Sbmath::PLInt Src, Sbmath::PLInt P, Sbmath::PLInt G, Sbmath::PLInt Y, Sbmath::PLInt A, Sbmath::PLInt B); 37 | extern PACKAGE bool __fastcall EncodeResult(void * R, int RSize, void * S, int SSize, void * Blob, int &BlobSize); 38 | extern PACKAGE bool __fastcall DecodeResult(void * Blob, int Size, void * R, int &RSize, void * S, int &SSize); 39 | extern PACKAGE bool __fastcall EncodePublicKey(void * P, int PSize, void * G, int GSize, void * Y, int YSize, void * OutBuffer, int &OutSize); 40 | extern PACKAGE bool __fastcall EncodePrivateKey(void * P, int PSize, void * G, int GSize, void * X, int XSize, void * OutBuffer, int &OutSize); 41 | 42 | } /* namespace Sbelgamal */ 43 | using namespace Sbelgamal; 44 | #pragma pack(pop) 45 | #pragma option pop 46 | 47 | #pragma delphiheader end. 48 | //-- end unit ---------------------------------------------------------------- 49 | #endif // SbelgamalHPP 50 | -------------------------------------------------------------------------------- /Sources/SBGOST341001.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbgost341001.pas' rev: 21.00 6 | 7 | #ifndef Sbgost341001HPP 8 | #define Sbgost341001HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbgost341001 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | //-- var, const, procedure --------------------------------------------------- 30 | extern PACKAGE bool __fastcall Generate(void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int Fld, void * D, int &DSize, void * Qx, int &QxSize, void * Qy, int &QySize); 31 | extern PACKAGE bool __fastcall Sign(void * hash, int hashSize, void * d, int dSize, void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int Fld, void * R, int &RSize, void * S, int &SSize); 32 | extern PACKAGE bool __fastcall DeriveKey(void * ukm, int ukmSize, void * D, int DSize, void * Qx, int QxSize, void * Qy, int QySize, void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int Fld, void * R, int &RSize, void * S, int &SSize); 33 | extern PACKAGE bool __fastcall Verify(void * hash, int hashSize, void * Qx, int QxSize, void * Qy, int QySize, void * R, int RSize, void * S, int SSize, void * A, int ASize, void * B, int BSize, void * X, int XSize, void * Y, int YSize, void * N, int NSize, void * P, int PSize, int Fld); 34 | 35 | } /* namespace Sbgost341001 */ 36 | using namespace Sbgost341001; 37 | #pragma pack(pop) 38 | #pragma option pop 39 | 40 | #pragma delphiheader end. 41 | //-- end unit ---------------------------------------------------------------- 42 | #endif // Sbgost341001HPP 43 | -------------------------------------------------------------------------------- /Sources/SBGOST341194.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbgost341194.pas' rev: 21.00 6 | 7 | #ifndef Sbgost341194HPP 8 | #define Sbgost341194HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbgost341194 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS TElGOSTMD; 30 | class PASCALIMPLEMENTATION TElGOSTMD : public Sbgostcommon::TElGOSTBase 31 | { 32 | typedef Sbgostcommon::TElGOSTBase inherited; 33 | 34 | protected: 35 | Sbtypes::ByteArray fH; 36 | Sbtypes::ByteArray fS; 37 | Sbtypes::ByteArray fM; 38 | Sbtypes::ByteArray fU; 39 | Sbtypes::ByteArray fV; 40 | Sbtypes::ByteArray fW; 41 | Sbtypes::ByteArray fTmp; 42 | Sbtypes::ByteArray fSum; 43 | __int64 fTotalLen; 44 | __classmethod virtual unsigned __fastcall GetBlockSize(); 45 | void __fastcall Hash_Block(const Sbtypes::ByteArray InBuf, int In_StartIdx); 46 | HIDESBASE void __fastcall Process_Block(const Sbtypes::ByteArray InBuf, int In_StartIdx); 47 | 48 | public: 49 | __classmethod int __fastcall DigestSize(); 50 | __fastcall TElGOSTMD(void)/* overload */; 51 | __fastcall TElGOSTMD(StaticArray const *SubstBlock)/* overload */; 52 | __fastcall virtual ~TElGOSTMD(void); 53 | virtual void __fastcall Reset(void); 54 | virtual void __fastcall Clone(Sbgostcommon::TElGOSTBase* Source); 55 | void __fastcall Update(void * In_Buf, unsigned Len)/* overload */; 56 | void __fastcall Update(const Sbtypes::ByteArray In_Buf, unsigned StartIndex, unsigned Len)/* overload */; 57 | void __fastcall Final(/* out */ Sbtypes::ByteArray &Digest); 58 | void __fastcall Calculate(const Sbtypes::ByteArray In_Buf, unsigned StartIndex, unsigned Len, /* out */ Sbtypes::ByteArray &Digest)/* overload */; 59 | void __fastcall Calculate(Classes::TStream* Source, unsigned Count, /* out */ Sbtypes::ByteArray &Digest)/* overload */; 60 | }; 61 | 62 | 63 | //-- var, const, procedure --------------------------------------------------- 64 | static const ShortInt c_GOST_DigestSize = 0x20; 65 | 66 | } /* namespace Sbgost341194 */ 67 | using namespace Sbgost341194; 68 | #pragma pack(pop) 69 | #pragma option pop 70 | 71 | #pragma delphiheader end. 72 | //-- end unit ---------------------------------------------------------------- 73 | #endif // Sbgost341194HPP 74 | -------------------------------------------------------------------------------- /Sources/SBHTTPAuth.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbhttpauth.pas' rev: 21.00 6 | 7 | #ifndef SbhttpauthHPP 8 | #define SbhttpauthHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | #include // Pascal unit 25 | #include // Pascal unit 26 | #include // Pascal unit 27 | #include // Pascal unit 28 | 29 | //-- user supplied ----------------------------------------------------------- 30 | 31 | namespace Sbhttpauth 32 | { 33 | //-- type declarations ------------------------------------------------------- 34 | typedef void * *PPointer; 35 | 36 | typedef int *PInteger; 37 | 38 | typedef unsigned *PLongWord; 39 | 40 | struct AUTH_SEQ 41 | { 42 | 43 | public: 44 | bool UUEncodeData; 45 | System::UnicodeString RequestURI; 46 | int RequestMethod; 47 | System::UnicodeString sNonce; 48 | System::UnicodeString cNonce; 49 | int cNonceCount; 50 | System::UnicodeString cRequest; 51 | }; 52 | 53 | 54 | typedef AUTH_SEQ *PAUTH_SEQ; 55 | 56 | //-- var, const, procedure --------------------------------------------------- 57 | extern PACKAGE System::UnicodeString cAuth; 58 | extern PACKAGE System::UnicodeString cAuth2; 59 | extern PACKAGE System::UnicodeString cPAuth; 60 | extern PACKAGE System::UnicodeString cPAuth2; 61 | extern PACKAGE System::UnicodeString cBasic; 62 | extern PACKAGE System::UnicodeString cNTLM; 63 | extern PACKAGE System::UnicodeString cDigest; 64 | extern PACKAGE bool secInit; 65 | extern PACKAGE char *TOKEN_SOURCE_NAME; 66 | extern PACKAGE void __fastcall ValidateSecPacks(Classes::TStringList* ls); 67 | extern PACKAGE void __fastcall AuthInit(PAUTH_SEQ pAS); 68 | extern PACKAGE void __fastcall AuthTerm(PAUTH_SEQ pAS); 69 | extern PACKAGE bool __fastcall AuthConverse(PAUTH_SEQ pAS, const Sbtypes::ByteArray BuffIn, /* out */ Sbtypes::ByteArray &BuffOut, bool &NeedMoreData, System::UnicodeString Package, System::UnicodeString User, const System::UnicodeString Password); 70 | extern PACKAGE bool __fastcall AddAuthorizationHeader(System::UnicodeString &Str, const System::UnicodeString Scheme, const System::UnicodeString AuthData, const System::UnicodeString UserName, const System::UnicodeString Password, bool &NeedMoreData, bool ForProxy, PAUTH_SEQ aSeq); 71 | extern PACKAGE void __fastcall InitAuthLib(void); 72 | 73 | } /* namespace Sbhttpauth */ 74 | using namespace Sbhttpauth; 75 | #pragma pack(pop) 76 | #pragma option pop 77 | 78 | #pragma delphiheader end. 79 | //-- end unit ---------------------------------------------------------------- 80 | #endif // SbhttpauthHPP 81 | -------------------------------------------------------------------------------- /Sources/SBHTTPSConstants.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbhttpsconstants.pas' rev: 21.00 6 | 7 | #ifndef SbhttpsconstantsHPP 8 | #define SbhttpsconstantsHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | 21 | //-- user supplied ----------------------------------------------------------- 22 | 23 | namespace Sbhttpsconstants 24 | { 25 | //-- type declarations ------------------------------------------------------- 26 | #pragma option push -b- 27 | enum TSBHTTPVersion { hvHTTP10, hvHTTP11 }; 28 | #pragma option pop 29 | 30 | #pragma option push -b- 31 | enum TSBHTTPChunkState { chSize, chLineFeed, chData, chHeader }; 32 | #pragma option pop 33 | 34 | typedef StaticArray Sbhttpsconstants__1; 35 | 36 | typedef StaticArray Sbhttpsconstants__2; 37 | 38 | typedef StaticArray Sbhttpsconstants__3; 39 | 40 | typedef StaticArray Sbhttpsconstants__4; 41 | 42 | typedef StaticArray Sbhttpsconstants__5; 43 | 44 | //-- var, const, procedure --------------------------------------------------- 45 | static const ShortInt SB_HTTP_REQUEST_CUSTOM = 0x0; 46 | static const ShortInt SB_HTTP_REQUEST_FIRST = 0x1; 47 | static const ShortInt SB_HTTP_REQUEST_GET = 0x1; 48 | static const ShortInt SB_HTTP_REQUEST_POST = 0x2; 49 | static const ShortInt SB_HTTP_REQUEST_HEAD = 0x3; 50 | static const ShortInt SB_HTTP_REQUEST_OPTIONS = 0x4; 51 | static const ShortInt SB_HTTP_REQUEST_DELETE = 0x5; 52 | static const ShortInt SB_HTTP_REQUEST_TRACE = 0x6; 53 | static const ShortInt SB_HTTP_REQUEST_PUT = 0x7; 54 | static const ShortInt SB_HTTP_REQUEST_CONNECT = 0x8; 55 | static const ShortInt SB_HTTP_REQUEST_LAST = 0x8; 56 | extern PACKAGE Sbhttpsconstants__1 HTTPVersionStrings; 57 | extern PACKAGE Sbhttpsconstants__2 HTTPCommandStrings; 58 | extern PACKAGE Sbhttpsconstants__3 WkDays; 59 | extern PACKAGE Sbhttpsconstants__4 WeekDays; 60 | extern PACKAGE Sbhttpsconstants__5 Months; 61 | extern PACKAGE Sbtypes::ByteArray HTTP10ByteArray; 62 | extern PACKAGE Sbtypes::ByteArray HTTP11ByteArray; 63 | extern PACKAGE System::ResourceString _SInvalidDateTime; 64 | #define Sbhttpsconstants_SInvalidDateTime System::LoadResourceString(&Sbhttpsconstants::_SInvalidDateTime) 65 | 66 | } /* namespace Sbhttpsconstants */ 67 | using namespace Sbhttpsconstants; 68 | #pragma pack(pop) 69 | #pragma option pop 70 | 71 | #pragma delphiheader end. 72 | //-- end unit ---------------------------------------------------------------- 73 | #endif // SbhttpsconstantsHPP 74 | -------------------------------------------------------------------------------- /Sources/SBHTTPSConstants.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SecBbox.inc} 11 | 12 | unit SBHTTPSConstants; 13 | 14 | interface 15 | 16 | uses 17 | SBTypes, 18 | SBConstants, 19 | SBUtils; 20 | 21 | 22 | type 23 | 24 | // TODO: in 9.0 move to SBHTTPSCommon 25 | TSBHTTPVersion = (hvHTTP10, hvHTTP11); 26 | 27 | TSBHTTPChunkState = 28 | (chSize, chLineFeed, chData, chHeader); 29 | 30 | const 31 | SB_HTTP_REQUEST_CUSTOM = 0; 32 | 33 | SB_HTTP_REQUEST_FIRST = 1; 34 | SB_HTTP_REQUEST_GET = 1; 35 | SB_HTTP_REQUEST_POST = 2; 36 | SB_HTTP_REQUEST_HEAD = 3; 37 | SB_HTTP_REQUEST_OPTIONS = 4; 38 | SB_HTTP_REQUEST_DELETE = 5; 39 | SB_HTTP_REQUEST_TRACE = 6; 40 | SB_HTTP_REQUEST_PUT = 7; 41 | SB_HTTP_REQUEST_CONNECT = 8; 42 | SB_HTTP_REQUEST_LAST = 8; 43 | 44 | const 45 | HTTPVersionStrings : array[ TSBHTTPVersion ] of string = 46 | ( 47 | 'HTTP/1.0', 'HTTP/1.1' 48 | ) ; 49 | 50 | HTTPCommandStrings: array[SB_HTTP_REQUEST_FIRST .. SB_HTTP_REQUEST_LAST] of string = 51 | ( 52 | 'GET', 'POST', 'HEAD', 'OPTIONS', 'DELETE', 'TRACE', 'PUT', 'CONNECT' 53 | ) ; 54 | 55 | WkDays: array[1..7] of string = 56 | ( 57 | 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' 58 | ) ; 59 | 60 | WeekDays: array[1..7] of string = 61 | ( 62 | 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 63 | 'Friday', 'Saturday', 'Sunday' 64 | ) ; 65 | 66 | Months: array[1..12] of string = 67 | ( 68 | 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 69 | 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' 70 | ) ; 71 | 72 | {$ifndef SB_NO_BYTEARRAY_CONST_ARRAYS} 73 | const 74 | {$else} 75 | var 76 | {$endif} 77 | 78 | HTTP10ByteArray : TByteArrayConst {$ifndef SB_NO_BYTEARRAY_CONST_ARRAYS} = 'HTTP/1.0' {$endif}; 79 | HTTP11ByteArray : TByteArrayConst {$ifndef SB_NO_BYTEARRAY_CONST_ARRAYS} = 'HTTP/1.1' {$endif}; 80 | 81 | resourcestring 82 | 83 | SInvalidDateTime = 'Invalid date/time parameter'; 84 | 85 | 86 | implementation 87 | 88 | initialization 89 | 90 | {$ifdef SB_NO_BYTEARRAY_CONST_ARRAYS} 91 | HTTP10ByteArray := BytesOfString('HTTP/1.0'); 92 | HTTP11ByteArray := BytesOfString('HTTP/1.1'); 93 | (* 94 | HTTPCommandStrings[SB_HTTP_REQUEST_GET] := BytesOfString('GET'); 95 | HTTPCommandStrings[SB_HTTP_REQUEST_POST] := BytesOfString('POST'); 96 | HTTPCommandStrings[SB_HTTP_REQUEST_HEAD] := BytesOfString('HEAD'); 97 | HTTPCommandStrings[SB_HTTP_REQUEST_OPTIONS] := BytesOfString('OPTIONS'); 98 | HTTPCommandStrings[SB_HTTP_REQUEST_DELETE] := BytesOfString('DELETE'); 99 | HTTPCommandStrings[SB_HTTP_REQUEST_TRACE] := BytesOfString('TRACE'); 100 | HTTPCommandStrings[SB_HTTP_REQUEST_PUT] := BytesOfString('PUT'); 101 | HTTPCommandStrings[SB_HTTP_REQUEST_CONNECT] := BytesOfString('CONNECT'); 102 | *) 103 | {$endif} 104 | 105 | end. 106 | -------------------------------------------------------------------------------- /Sources/SBIDEA.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbidea.pas' rev: 21.00 6 | 7 | #ifndef SbideaHPP 8 | #define SbideaHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbidea 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | typedef StaticArray TIDEAKey; 26 | 27 | typedef TIDEAKey *PIDEAKey; 28 | 29 | typedef StaticArray TIDEAExpandedKey; 30 | 31 | typedef TIDEAExpandedKey *PIDEAExpandedKey; 32 | 33 | //-- var, const, procedure --------------------------------------------------- 34 | static const ShortInt TIDEAExpandedKeySize = 0x68; 35 | extern PACKAGE bool IdeaEnabled; 36 | extern PACKAGE void __fastcall ExpandKeyForEncryption(System::Byte const *Key, /* out */ System::Word *ExpandedKey); 37 | extern PACKAGE void __fastcall ExpandKeyForDecryption(System::Word const *CipherKey, /* out */ System::Word *DecipherKey); 38 | extern PACKAGE void __fastcall Encrypt(unsigned &B0, unsigned &B1, System::Word const *Key); 39 | 40 | } /* namespace Sbidea */ 41 | using namespace Sbidea; 42 | #pragma pack(pop) 43 | #pragma option pop 44 | 45 | #pragma delphiheader end. 46 | //-- end unit ---------------------------------------------------------------- 47 | #endif // SbideaHPP 48 | -------------------------------------------------------------------------------- /Sources/SBMD.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbmd.pas' rev: 21.00 6 | 7 | #ifndef SbmdHPP 8 | #define SbmdHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | 21 | //-- user supplied ----------------------------------------------------------- 22 | 23 | namespace Sbmd 24 | { 25 | //-- type declarations ------------------------------------------------------- 26 | #pragma pack(push,1) 27 | struct TMD5Context 28 | { 29 | 30 | public: 31 | __int64 Size; 32 | StaticArray Buffer; 33 | unsigned BufSize; 34 | unsigned A; 35 | unsigned B; 36 | unsigned C; 37 | unsigned D; 38 | }; 39 | #pragma pack(pop) 40 | 41 | 42 | #pragma pack(push,1) 43 | struct TMD2Context 44 | { 45 | 46 | public: 47 | __int64 Size; 48 | StaticArray Checksum; 49 | StaticArray Buffer; 50 | int BufSize; 51 | StaticArray State; 52 | }; 53 | #pragma pack(pop) 54 | 55 | 56 | //-- var, const, procedure --------------------------------------------------- 57 | extern PACKAGE void __fastcall InternalMD5(Sbtypes::PLongWordArray Chunk, unsigned &A, unsigned &B, unsigned &C, unsigned &D); 58 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall HashMD5(const Sbtypes::ByteArray Buffer)/* overload */; 59 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall HashMD5(void * Buffer, unsigned Size)/* overload */; 60 | extern PACKAGE void __fastcall InitializeMD5(TMD5Context &Context); 61 | extern PACKAGE void __fastcall HashMD5(TMD5Context &Context, void * Chunk, unsigned Size)/* overload */; 62 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall FinalizeMD5(TMD5Context &Context); 63 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall HashMD2(void * Buffer, unsigned Size)/* overload */; 64 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall HashMD2(const Sbtypes::ByteArray S)/* overload */; 65 | extern PACKAGE void __fastcall InitializeMD2(TMD2Context &Context); 66 | extern PACKAGE Sbtypes::TMessageDigest128 __fastcall FinalizeMD2(TMD2Context &Context); 67 | extern PACKAGE void __fastcall HashMD2(TMD2Context &Context, void * Buffer, int Size)/* overload */; 68 | 69 | } /* namespace Sbmd */ 70 | using namespace Sbmd; 71 | #pragma pack(pop) 72 | #pragma option pop 73 | 74 | #pragma delphiheader end. 75 | //-- end unit ---------------------------------------------------------------- 76 | #endif // SbmdHPP 77 | -------------------------------------------------------------------------------- /Sources/SBMSKeyBlob.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbmskeyblob.pas' rev: 21.00 6 | 7 | #ifndef SbmskeyblobHPP 8 | #define SbmskeyblobHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbmskeyblob 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS EElMSKeyBlobError; 30 | class PASCALIMPLEMENTATION EElMSKeyBlobError : public Sbutils::ESecureBlackboxError 31 | { 32 | typedef Sbutils::ESecureBlackboxError inherited; 33 | 34 | public: 35 | /* ESecureBlackboxError.Create */ inline __fastcall EElMSKeyBlobError(const System::UnicodeString AMessage)/* overload */ : Sbutils::ESecureBlackboxError(AMessage) { } 36 | 37 | public: 38 | /* Exception.CreateFmt */ inline __fastcall EElMSKeyBlobError(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size) : Sbutils::ESecureBlackboxError(Msg, Args, Args_Size) { } 39 | /* Exception.CreateRes */ inline __fastcall EElMSKeyBlobError(int Ident)/* overload */ : Sbutils::ESecureBlackboxError(Ident) { } 40 | /* Exception.CreateResFmt */ inline __fastcall EElMSKeyBlobError(int Ident, System::TVarRec const *Args, const int Args_Size)/* overload */ : Sbutils::ESecureBlackboxError(Ident, Args, Args_Size) { } 41 | /* Exception.CreateHelp */ inline __fastcall EElMSKeyBlobError(const System::UnicodeString Msg, int AHelpContext) : Sbutils::ESecureBlackboxError(Msg, AHelpContext) { } 42 | /* Exception.CreateFmtHelp */ inline __fastcall EElMSKeyBlobError(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size, int AHelpContext) : Sbutils::ESecureBlackboxError(Msg, Args, Args_Size, AHelpContext) { } 43 | /* Exception.CreateResHelp */ inline __fastcall EElMSKeyBlobError(int Ident, int AHelpContext)/* overload */ : Sbutils::ESecureBlackboxError(Ident, AHelpContext) { } 44 | /* Exception.CreateResFmtHelp */ inline __fastcall EElMSKeyBlobError(System::PResStringRec ResStringRec, System::TVarRec const *Args, const int Args_Size, int AHelpContext)/* overload */ : Sbutils::ESecureBlackboxError(ResStringRec, Args, Args_Size, AHelpContext) { } 45 | /* Exception.Destroy */ inline __fastcall virtual ~EElMSKeyBlobError(void) { } 46 | 47 | }; 48 | 49 | 50 | //-- var, const, procedure --------------------------------------------------- 51 | static const int SB_MSKEYBLOB_ERROR_UNSUPPORTED_BLOB_TYPE = 8449; 52 | static const int SB_MSKEYBLOB_ERROR_INVALID_FORMAT = 8450; 53 | static const int SB_MSKEYBLOB_ERROR_UNSUPPORTED_VERSION = 8451; 54 | static const int SB_MSKEYBLOB_ERROR_BUFFER_TOO_SMALL = 8452; 55 | static const int SB_MSKEYBLOB_ERROR_NO_PRIVATE_KEY = 8453; 56 | static const int SB_MSKEYBLOB_ERROR_UNSUPPORTED_ALGORITHM = 8454; 57 | static const ShortInt SB_KEY_BLOB_RSA = 0x1; 58 | static const ShortInt SB_KEY_BLOB_DSS = 0x2; 59 | extern PACKAGE bool __fastcall WriteMSKeyBlobEx(void * Buffer, int Size, void * OutBuffer, int &OutSize, Sbalgorithmidentifier::TElAlgorithmIdentifier* Algorithm); 60 | extern PACKAGE int __fastcall ParseMSKeyBlob(void * Buffer, int Size, void * OutBuffer, int &OutSize, /* out */ int &BlobType); 61 | extern PACKAGE bool __fastcall WriteMSKeyBlob(void * Buffer, int Size, void * OutBuffer, int &OutSize, System::Byte BlobType); 62 | extern PACKAGE bool __fastcall WriteMSPublicKeyBlob(void * Buffer, int Size, void * OutBuffer, int &OutSize, int BlobType); 63 | extern PACKAGE bool __fastcall WriteMSDSSPublicKeyBlob(void * P, int PSize, void * Q, int QSize, void * G, int GSize, void * Y, int YSize, void * OutBuffer, int &OutSize); 64 | 65 | } /* namespace Sbmskeyblob */ 66 | using namespace Sbmskeyblob; 67 | #pragma pack(pop) 68 | #pragma option pop 69 | 70 | #pragma delphiheader end. 71 | //-- end unit ---------------------------------------------------------------- 72 | #endif // SbmskeyblobHPP 73 | -------------------------------------------------------------------------------- /Sources/SBOCSPStorage.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbocspstorage.pas' rev: 21.00 6 | 7 | #ifndef SbocspstorageHPP 8 | #define SbocspstorageHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | #include // Pascal unit 25 | 26 | //-- user supplied ----------------------------------------------------------- 27 | 28 | namespace Sbocspstorage 29 | { 30 | //-- type declarations ------------------------------------------------------- 31 | class DELPHICLASS TElOCSPResponseStorage; 32 | class PASCALIMPLEMENTATION TElOCSPResponseStorage : public Classes::TPersistent 33 | { 34 | typedef Classes::TPersistent inherited; 35 | 36 | private: 37 | Classes::TList* FList; 38 | Sbocspclient::TElOCSPResponse* __fastcall GetResponse(int Index); 39 | int __fastcall GetCount(void); 40 | 41 | public: 42 | __fastcall TElOCSPResponseStorage(void); 43 | __fastcall virtual ~TElOCSPResponseStorage(void); 44 | int __fastcall Add(Sbocspclient::TElOCSPResponse* Resp)/* overload */; 45 | int __fastcall Add(void)/* overload */; 46 | void __fastcall Remove(int Index); 47 | int __fastcall IndexOf(Sbocspclient::TElOCSPResponse* Resp); 48 | void __fastcall Clear(void); 49 | __property Sbocspclient::TElOCSPResponse* Responses[int Index] = {read=GetResponse}; 50 | __property int Count = {read=GetCount, nodefault}; 51 | }; 52 | 53 | 54 | //-- var, const, procedure --------------------------------------------------- 55 | 56 | } /* namespace Sbocspstorage */ 57 | using namespace Sbocspstorage; 58 | #pragma pack(pop) 59 | #pragma option pop 60 | 61 | #pragma delphiheader end. 62 | //-- end unit ---------------------------------------------------------------- 63 | #endif // SbocspstorageHPP 64 | -------------------------------------------------------------------------------- /Sources/SBOCSPStorage.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SecBbox.inc} 11 | 12 | unit SBOCSPStorage; 13 | 14 | interface 15 | 16 | uses 17 | Classes, 18 | SysUtils, 19 | {$ifdef SB_UNICODE_VCL} 20 | {$endif} 21 | SBConstants, 22 | SBTypes, 23 | SBUtils, 24 | SBOCSPCommon, 25 | SBOCSPClient, 26 | SBPKICommon; 27 | 28 | 29 | type 30 | TElOCSPResponseStorage = class (TPersistent) 31 | private 32 | FList : TElList; 33 | function GetResponse(Index : integer): TElOCSPResponse; 34 | function GetCount : integer; 35 | public 36 | constructor Create; 37 | destructor Destroy; override; 38 | function Add(Resp : TElOCSPResponse): integer; overload; 39 | function Add(): integer; overload; 40 | procedure Remove(Index : integer); 41 | function IndexOf(Resp : TElOCSPResponse): integer; 42 | procedure Clear; 43 | property Responses[Index: integer]: TElOCSPResponse read GetResponse; 44 | property Count : integer read GetCount; 45 | end; 46 | 47 | implementation 48 | 49 | //////////////////////////////////////////////////////////////////////////////// 50 | // TElOCSPResponseStorage class 51 | 52 | constructor TElOCSPResponseStorage.Create; 53 | begin 54 | inherited; 55 | FList := TElList.Create; 56 | end; 57 | 58 | destructor TElOCSPResponseStorage.Destroy; 59 | begin 60 | Clear; 61 | FreeAndNil(FList); 62 | inherited; 63 | end; 64 | 65 | function TElOCSPResponseStorage.Add(Resp : TElOCSPResponse): integer; 66 | var 67 | NewResp : TElOCSPResponse; 68 | begin 69 | NewResp := TElOCSPResponse.Create; 70 | NewResp.Assign(Resp); 71 | Result := FList.Add(NewResp); 72 | end; 73 | 74 | function TElOCSPResponseStorage.Add(): integer; 75 | begin 76 | Result := FList.Add(TElOCSPResponse.Create); 77 | end; 78 | 79 | procedure TElOCSPResponseStorage.Remove(Index : integer); 80 | var 81 | Resp : TElOCSPResponse; 82 | begin 83 | Resp := TElOCSPResponse(FList[Index]); 84 | FList. Delete (Index); 85 | FreeAndNil(Resp); 86 | end; 87 | 88 | function TElOCSPResponseStorage.IndexOf(Resp : TElOCSPResponse): integer; 89 | var 90 | I : integer; 91 | begin 92 | Result := -1; 93 | for I := 0 to FList.Count - 1 do 94 | if TElOCSPResponse(FList[I]).EqualsTo(Resp) then 95 | begin 96 | Result := I; 97 | Break; 98 | end; 99 | end; 100 | 101 | procedure TElOCSPResponseStorage.Clear; 102 | var 103 | I : integer; 104 | Resp : TElOCSPResponse; 105 | begin 106 | try 107 | for I := 0 to FList.Count - 1 do 108 | begin 109 | Resp := TElOCSPResponse(FList[I]); 110 | FreeAndNil(Resp); 111 | end; 112 | finally 113 | FList.Clear; 114 | end; 115 | end; 116 | 117 | function TElOCSPResponseStorage.GetResponse(Index : integer): TElOCSPResponse; 118 | begin 119 | Result := TElOCSPResponse(FList[Index]); 120 | end; 121 | 122 | function TElOCSPResponseStorage.GetCount : integer; 123 | begin 124 | Result := FList.Count; 125 | end; 126 | 127 | end. 128 | -------------------------------------------------------------------------------- /Sources/SBPKICommon.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbpkicommon.pas' rev: 21.00 6 | 7 | #ifndef SbpkicommonHPP 8 | #define SbpkicommonHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbpkicommon 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | #pragma option push -b- 26 | enum TSBCMSSignatureValidity { csvValid, csvInvalid, csvSignerNotFound, csvGeneralFailure }; 27 | #pragma option pop 28 | 29 | #pragma option push -b- 30 | enum TSBCMSValidationOption { cvoRecursiveValidation, cvoValidateChains, cvoValidateTimes, cvoCheckRevocationStatus, cvoRequireTimestamps, cvoIgnoreLocalTimestamps, cvoValidateTrusts }; 31 | #pragma option pop 32 | 33 | typedef Set TSBCMSValidationOptions; 34 | 35 | #pragma option push -b- 36 | enum TSBCMSAdvancedSignatureValidity { casvValid, casvSignatureCorrupted, casvSignerNotFound, casvIncompleteChain, casvBadCountersignature, casvBadTimestamp, casvCertificateExpired, casvCertificateRevoked, casvCertificateCorrupted, casvUntrustedCA, casvRevInfoNotFound, casvTimestampInfoNotFound, casvFailure, casvCertificateMalformed, casvUnknown, casvChainValidationFailed }; 37 | #pragma option pop 38 | 39 | #pragma option push -b- 40 | enum TSBPKIStatus { psGranted, psGrantedWithMods, psRejection, psWaiting, psRevocationWarning, psRevocationNotification, psKeyUpdateWarning }; 41 | #pragma option pop 42 | 43 | #pragma option push -b- 44 | enum TSBPKIFailureInfo { pfiBadAlg, pfiBadMessageCheck, pfiBadRequest, pfiBadTime, pfiBadCertId, pfiBadDataFormat, pfiWrongAuthority, pfiIncorrectData, pfiMissingTimeStamp, pfiBadPOP }; 45 | #pragma option pop 46 | 47 | //-- var, const, procedure --------------------------------------------------- 48 | 49 | } /* namespace Sbpkicommon */ 50 | using namespace Sbpkicommon; 51 | #pragma pack(pop) 52 | #pragma option pop 53 | 54 | #pragma delphiheader end. 55 | //-- end unit ---------------------------------------------------------------- 56 | #endif // SbpkicommonHPP 57 | -------------------------------------------------------------------------------- /Sources/SBPKICommon.pas: -------------------------------------------------------------------------------- 1 | (******************************************************) 2 | (* *) 3 | (* EldoS SecureBlackbox Library *) 4 | (* *) 5 | (* Copyright (c) 2002-2014 EldoS Corporation *) 6 | (* http://www.secureblackbox.com *) 7 | (* *) 8 | (******************************************************) 9 | 10 | {$I SecBbox.inc} 11 | 12 | unit SBPKICommon; 13 | 14 | interface 15 | 16 | uses 17 | SBX509, SBPKCS7Utils; 18 | 19 | 20 | 21 | type 22 | TSBCMSSignatureValidity = (csvValid, csvInvalid, csvSignerNotFound, csvGeneralFailure); 23 | 24 | TSBCMSValidationOption = (cvoRecursiveValidation, cvoValidateChains, 25 | cvoValidateTimes, cvoCheckRevocationStatus, cvoRequireTimestamps, 26 | cvoIgnoreLocalTimestamps, cvoValidateTrusts); 27 | TSBCMSValidationOptions = set of TSBCMSValidationOption; 28 | 29 | // add casvCheckCertPurposes 30 | TSBCMSAdvancedSignatureValidity = (casvValid, casvSignatureCorrupted, 31 | casvSignerNotFound, casvIncompleteChain, casvBadCountersignature, casvBadTimestamp, 32 | casvCertificateExpired, casvCertificateRevoked, casvCertificateCorrupted, 33 | casvUntrustedCA, casvRevInfoNotFound, casvTimestampInfoNotFound, casvFailure, 34 | casvCertificateMalformed, casvUnknown, casvChainValidationFailed); 35 | 36 | 37 | type 38 | TSBPKIStatus = (psGranted, psGrantedWithMods, psRejection, psWaiting, 39 | psRevocationWarning, psRevocationNotification, psKeyUpdateWarning); 40 | 41 | TSBPKIFailureInfo = (pfiBadAlg, pfiBadMessageCheck, pfiBadRequest, 42 | pfiBadTime, pfiBadCertId, pfiBadDataFormat, pfiWrongAuthority, 43 | pfiIncorrectData, pfiMissingTimeStamp, pfiBadPOP); 44 | 45 | implementation 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /Sources/SBRC2.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbrc2.pas' rev: 21.00 6 | 7 | #ifndef Sbrc2HPP 8 | #define Sbrc2HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | 21 | //-- user supplied ----------------------------------------------------------- 22 | 23 | namespace Sbrc2 24 | { 25 | //-- type declarations ------------------------------------------------------- 26 | typedef DynamicArray TRC2Key; 27 | 28 | typedef StaticArray TRC2ExpandedKey; 29 | 30 | //-- var, const, procedure --------------------------------------------------- 31 | static const ShortInt TRC2BufferSize = 0x8; 32 | static const ShortInt TRC2ExpandedKeyLength = 0x40; 33 | extern PACKAGE void __fastcall ExpandKey(const TRC2Key Key, /* out */ System::Word *ExpandedKey); 34 | extern PACKAGE void __fastcall Encrypt(unsigned &B0, unsigned &B1, System::Word const *ExpandedKey); 35 | extern PACKAGE void __fastcall Decrypt(unsigned &B0, unsigned &B1, System::Word const *ExpandedKey); 36 | extern PACKAGE bool __fastcall ParseASN1Params(const Sbtypes::ByteArray Params, Sbtypes::ByteArray &IV, int &KeyBits); 37 | extern PACKAGE void __fastcall WriteASN1Params(const Sbtypes::ByteArray IV, int KeyBits, Sbtypes::ByteArray &Params); 38 | 39 | } /* namespace Sbrc2 */ 40 | using namespace Sbrc2; 41 | #pragma pack(pop) 42 | #pragma option pop 43 | 44 | #pragma delphiheader end. 45 | //-- end unit ---------------------------------------------------------------- 46 | #endif // Sbrc2HPP 47 | -------------------------------------------------------------------------------- /Sources/SBRC4.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbrc4.pas' rev: 21.00 6 | 7 | #ifndef Sbrc4HPP 8 | #define Sbrc4HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbrc4 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef DynamicArray TRC4Key; 28 | 29 | typedef StaticArray TRC4ExpandedKey; 30 | 31 | struct TRC4Context 32 | { 33 | 34 | public: 35 | System::Byte L; 36 | System::Byte K; 37 | StaticArray TK; 38 | }; 39 | 40 | 41 | //-- var, const, procedure --------------------------------------------------- 42 | extern PACKAGE void __fastcall Initialize(TRC4Context &Context, const TRC4Key Key); 43 | extern PACKAGE bool __fastcall Encrypt(TRC4Context &Context, void * Buf, void * OutBuf, unsigned Size)/* overload */; 44 | extern PACKAGE bool __fastcall Decrypt(TRC4Context &Context, void * Buf, void * OutBuf, unsigned Size)/* overload */; 45 | extern PACKAGE bool __fastcall NFinalize(TRC4Context &Context); 46 | extern PACKAGE void __fastcall Encrypt(void * InBuffer, const int Size, System::Byte const *ExpandedKey, void * OutBuffer)/* overload */; 47 | extern PACKAGE void __fastcall Decrypt(void * InBuffer, const int Size, System::Byte const *ExpandedKey, void * OutBuffer)/* overload */; 48 | 49 | } /* namespace Sbrc4 */ 50 | using namespace Sbrc4; 51 | #pragma pack(pop) 52 | #pragma option pop 53 | 54 | #pragma delphiheader end. 55 | //-- end unit ---------------------------------------------------------------- 56 | #endif // Sbrc4HPP 57 | -------------------------------------------------------------------------------- /Sources/SBRIPEMD.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbripemd.pas' rev: 21.00 6 | 7 | #ifndef SbripemdHPP 8 | #define SbripemdHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbripemd 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef StaticArray TRMD160Buffer; 28 | 29 | #pragma pack(push,1) 30 | struct TRMD160Context 31 | { 32 | 33 | public: 34 | TRMD160Buffer Buffer; 35 | unsigned BufSize; 36 | unsigned h1; 37 | unsigned h2; 38 | unsigned h3; 39 | unsigned h4; 40 | unsigned h5; 41 | unsigned MessageSizeLo; 42 | unsigned MessageSizeHi; 43 | }; 44 | #pragma pack(pop) 45 | 46 | 47 | //-- var, const, procedure --------------------------------------------------- 48 | extern PACKAGE void __fastcall InitializeRMD160(TRMD160Context &Context); 49 | extern PACKAGE void __fastcall HashRMD160(TRMD160Context &Context, void * Chunk, int Size)/* overload */; 50 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall HashRMD160(void * Buffer, int Size)/* overload */; 51 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall HashRMD160(const System::UnicodeString Buffer)/* overload */; 52 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall HashRMD160(const Sbtypes::ByteArray Buffer)/* overload */; 53 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall FinalizeRMD160(TRMD160Context &Context); 54 | 55 | } /* namespace Sbripemd */ 56 | using namespace Sbripemd; 57 | #pragma pack(pop) 58 | #pragma option pop 59 | 60 | #pragma delphiheader end. 61 | //-- end unit ---------------------------------------------------------------- 62 | #endif // SbripemdHPP 63 | -------------------------------------------------------------------------------- /Sources/SBRabbit.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbrabbit.pas' rev: 21.00 6 | 7 | #ifndef SbrabbitHPP 8 | #define SbrabbitHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbrabbit 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | typedef unsigned UInt32; 28 | 29 | typedef __int64 UInt64; 30 | 31 | typedef StaticArray UInt32Array8; 32 | 33 | #pragma pack(push,1) 34 | struct Rabbit_Instance 35 | { 36 | 37 | public: 38 | UInt32Array8 X; 39 | UInt32Array8 C; 40 | UInt32Array8 K; 41 | System::Byte Carry; 42 | }; 43 | #pragma pack(pop) 44 | 45 | 46 | #pragma pack(push,1) 47 | struct Rabbit_Context 48 | { 49 | 50 | public: 51 | Rabbit_Instance Rabbit; 52 | Rabbit_Instance Rabbit_Master; 53 | }; 54 | #pragma pack(pop) 55 | 56 | 57 | //-- var, const, procedure --------------------------------------------------- 58 | extern PACKAGE void __fastcall Rabbit_Cipher(Rabbit_Context &Context, const Sbtypes::ByteArray Src, Sbtypes::ByteArray &Dst); 59 | extern PACKAGE void __fastcall Rabbit_IVInit(Rabbit_Context &Context, const Sbtypes::ByteArray IV_Key); 60 | extern PACKAGE void __fastcall Rabbit_Init(Rabbit_Context &Context, const Sbtypes::ByteArray Key); 61 | 62 | } /* namespace Sbrabbit */ 63 | using namespace Sbrabbit; 64 | #pragma pack(pop) 65 | #pragma option pop 66 | 67 | #pragma delphiheader end. 68 | //-- end unit ---------------------------------------------------------------- 69 | #endif // SbrabbitHPP 70 | -------------------------------------------------------------------------------- /Sources/SBRandom.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbrandom.pas' rev: 21.00 6 | 7 | #ifndef SbrandomHPP 8 | #define SbrandomHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | 25 | //-- user supplied ----------------------------------------------------------- 26 | 27 | namespace Sbrandom 28 | { 29 | //-- type declarations ------------------------------------------------------- 30 | class DELPHICLASS TElRandom; 31 | class PASCALIMPLEMENTATION TElRandom : public System::TObject 32 | { 33 | typedef System::TObject inherited; 34 | 35 | private: 36 | StaticArray S; 37 | int CI; 38 | int CJ; 39 | 40 | public: 41 | __fastcall TElRandom(void)/* overload */; 42 | __fastcall TElRandom(unsigned TimeSeed)/* overload */; 43 | __fastcall virtual ~TElRandom(void); 44 | void __fastcall Randomize(const Sbtypes::ByteArray Seed)/* overload */; 45 | void __fastcall Randomize(Classes::TStream* Stream, int Count = 0x0)/* overload */; 46 | Sbtypes::ByteArray __fastcall Generate(int Count)/* overload */; 47 | void __fastcall Randomize(void * Buffer, int Count)/* overload */; 48 | void __fastcall Generate(void * Buffer, int Count)/* overload */; 49 | void __fastcall Seed(void * Buffer, int Count); 50 | void __fastcall Generate(Classes::TStream* Stream, int Count)/* overload */; 51 | }; 52 | 53 | typedef TElRandom ElRandom 54 | //-- var, const, procedure --------------------------------------------------- 55 | extern PACKAGE int __fastcall SBRndTimeSeed(void); 56 | extern PACKAGE void __fastcall SBRndInit(void); 57 | extern PACKAGE void __fastcall SBRndCreate(void); 58 | extern PACKAGE void __fastcall SBRndDestroy(void); 59 | extern PACKAGE void __fastcall SBRndSeed(const System::UnicodeString Salt = L"")/* overload */; 60 | extern PACKAGE void __fastcall SBRndSeed(void * Buffer, int Size)/* overload */; 61 | extern PACKAGE void __fastcall SBRndSeedTime(void); 62 | extern PACKAGE void __fastcall SBRndGenerate(void * Buffer, int Size)/* overload */; 63 | extern PACKAGE unsigned __fastcall SBRndGenerate(unsigned UpperBound = (unsigned)(0x0))/* overload */; 64 | extern PACKAGE void __fastcall SBRndGenerateLInt(Sbmath::PLInt A, int Bytes); 65 | extern PACKAGE void __fastcall SBRndRandomize(const Sbtypes::ByteArray Seed); 66 | 67 | } /* namespace Sbrandom */ 68 | using namespace Sbrandom; 69 | #pragma pack(pop) 70 | #pragma option pop 71 | 72 | #pragma delphiheader end. 73 | //-- end unit ---------------------------------------------------------------- 74 | #endif // SbrandomHPP 75 | -------------------------------------------------------------------------------- /Sources/SBSHA.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsha.pas' rev: 21.00 6 | 7 | #ifndef SbshaHPP 8 | #define SbshaHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbsha 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | #pragma pack(push,1) 28 | struct TSHA1Context 29 | { 30 | 31 | public: 32 | __int64 Size; 33 | StaticArray Buffer; 34 | StaticArray LChunk; 35 | unsigned BufSize; 36 | unsigned A; 37 | unsigned B; 38 | unsigned C; 39 | unsigned D; 40 | unsigned E; 41 | }; 42 | #pragma pack(pop) 43 | 44 | 45 | //-- var, const, procedure --------------------------------------------------- 46 | extern PACKAGE void __fastcall InternalSHA1(Sbtypes::PLongWordArray Chunk, unsigned &A, unsigned &B, unsigned &C, unsigned &D, unsigned &E); 47 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall HashSHA1(const Sbtypes::ByteArray S)/* overload */; 48 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall HashSHA1(void * Buffer, unsigned Size)/* overload */; 49 | extern PACKAGE void __fastcall InitializeSHA1(/* out */ TSHA1Context &Context); 50 | extern PACKAGE void __fastcall HashSHA1(TSHA1Context &Context, void * Chunk, unsigned Size)/* overload */; 51 | extern PACKAGE Sbtypes::TMessageDigest160 __fastcall FinalizeSHA1(TSHA1Context &Context); 52 | 53 | } /* namespace Sbsha */ 54 | using namespace Sbsha; 55 | #pragma pack(pop) 56 | #pragma option pop 57 | 58 | #pragma delphiheader end. 59 | //-- end unit ---------------------------------------------------------------- 60 | #endif // SbshaHPP 61 | -------------------------------------------------------------------------------- /Sources/SBSHA2.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsha2.pas' rev: 21.00 6 | 7 | #ifndef Sbsha2HPP 8 | #define Sbsha2HPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | 22 | //-- user supplied ----------------------------------------------------------- 23 | 24 | namespace Sbsha2 25 | { 26 | //-- type declarations ------------------------------------------------------- 27 | #pragma pack(push,1) 28 | struct TSHA256Context 29 | { 30 | 31 | public: 32 | __int64 Size; 33 | StaticArray Buffer; 34 | unsigned BufSize; 35 | unsigned A; 36 | unsigned B; 37 | unsigned C; 38 | unsigned D; 39 | unsigned E; 40 | unsigned F; 41 | unsigned G; 42 | unsigned H; 43 | }; 44 | #pragma pack(pop) 45 | 46 | 47 | #pragma pack(push,1) 48 | struct TSHA512Context 49 | { 50 | 51 | public: 52 | __int64 Size; 53 | StaticArray Buffer; 54 | unsigned BufSize; 55 | __int64 A; 56 | __int64 B; 57 | __int64 C; 58 | __int64 D; 59 | __int64 E; 60 | __int64 F; 61 | __int64 G; 62 | __int64 H; 63 | }; 64 | #pragma pack(pop) 65 | 66 | 67 | typedef TSHA512Context TSHA384Context; 68 | 69 | //-- var, const, procedure --------------------------------------------------- 70 | extern PACKAGE void __fastcall InitializeSHA224(TSHA256Context &Context); 71 | extern PACKAGE Sbtypes::TMessageDigest224 __fastcall HashSHA224(const Sbtypes::ByteArray S)/* overload */; 72 | extern PACKAGE void __fastcall HashSHA224(TSHA256Context &Context, void * Chunk, unsigned Size)/* overload */; 73 | extern PACKAGE Sbtypes::TMessageDigest224 __fastcall HashSHA224(void * Buffer, unsigned Size)/* overload */; 74 | extern PACKAGE Sbtypes::TMessageDigest224 __fastcall FinalizeSHA224(TSHA256Context &Context); 75 | extern PACKAGE void __fastcall InitializeSHA256(TSHA256Context &Context); 76 | extern PACKAGE Sbtypes::TMessageDigest256 __fastcall HashSHA256(const Sbtypes::ByteArray S)/* overload */; 77 | extern PACKAGE void __fastcall HashSHA256(TSHA256Context &Context, void * Chunk, unsigned Size)/* overload */; 78 | extern PACKAGE Sbtypes::TMessageDigest256 __fastcall HashSHA256(void * Buffer, unsigned Size)/* overload */; 79 | extern PACKAGE Sbtypes::TMessageDigest256 __fastcall FinalizeSHA256(TSHA256Context &Context); 80 | extern PACKAGE void __fastcall InitializeSHA512(TSHA512Context &Context); 81 | extern PACKAGE Sbtypes::TMessageDigest512 __fastcall HashSHA512(const Sbtypes::ByteArray S)/* overload */; 82 | extern PACKAGE void __fastcall HashSHA512(TSHA512Context &Context, void * Chunk, unsigned Size)/* overload */; 83 | extern PACKAGE Sbtypes::TMessageDigest512 __fastcall HashSHA512(void * Buffer, unsigned Size)/* overload */; 84 | extern PACKAGE Sbtypes::TMessageDigest512 __fastcall FinalizeSHA512(TSHA512Context &Context); 85 | extern PACKAGE void __fastcall InitializeSHA384(TSHA512Context &Context); 86 | extern PACKAGE Sbtypes::TMessageDigest384 __fastcall HashSHA384(const Sbtypes::ByteArray S)/* overload */; 87 | extern PACKAGE void __fastcall HashSHA384(TSHA512Context &Context, void * Chunk, unsigned Size)/* overload */; 88 | extern PACKAGE Sbtypes::TMessageDigest384 __fastcall HashSHA384(void * Buffer, unsigned Size)/* overload */; 89 | extern PACKAGE Sbtypes::TMessageDigest384 __fastcall FinalizeSHA384(TSHA512Context &Context); 90 | 91 | } /* namespace Sbsha2 */ 92 | using namespace Sbsha2; 93 | #pragma pack(pop) 94 | #pragma option pop 95 | 96 | #pragma delphiheader end. 97 | //-- end unit ---------------------------------------------------------------- 98 | #endif // Sbsha2HPP 99 | -------------------------------------------------------------------------------- /Sources/SBSMIMESignatures.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsmimesignatures.pas' rev: 21.00 6 | 7 | #ifndef SbsmimesignaturesHPP 8 | #define SbsmimesignaturesHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | 23 | //-- user supplied ----------------------------------------------------------- 24 | 25 | namespace Sbsmimesignatures 26 | { 27 | //-- type declarations ------------------------------------------------------- 28 | class DELPHICLASS TElSMIMEMessageSigner; 29 | class PASCALIMPLEMENTATION TElSMIMEMessageSigner : public Sbmessages::TElMessageSigner 30 | { 31 | typedef Sbmessages::TElMessageSigner inherited; 32 | 33 | public: 34 | virtual int __fastcall Sign(void * InBuffer, int InSize, void * OutBuffer, int &OutSize, bool Detached = false)/* overload */; 35 | public: 36 | /* TElMessageSigner.Create */ inline __fastcall virtual TElSMIMEMessageSigner(Classes::TComponent* AOwner) : Sbmessages::TElMessageSigner(AOwner) { } 37 | /* TElMessageSigner.Destroy */ inline __fastcall virtual ~TElSMIMEMessageSigner(void) { } 38 | 39 | 40 | /* Hoisted overloads: */ 41 | 42 | public: 43 | inline int __fastcall Sign(Classes::TStream* InStream, Classes::TStream* OutStream, bool Detached = false, __int64 InCount = 0x000000000){ return Sbmessages::TElMessageSigner::Sign(InStream, OutStream, Detached, InCount); } 44 | 45 | }; 46 | 47 | typedef TElSMIMEMessageSigner ElSMIMEMessageSigner 48 | class DELPHICLASS TElSMIMEMessageVerifier; 49 | class PASCALIMPLEMENTATION TElSMIMEMessageVerifier : public Sbmessages::TElMessageVerifier 50 | { 51 | typedef Sbmessages::TElMessageVerifier inherited; 52 | 53 | private: 54 | System::TDateTime __fastcall ProcessTime(const Sbtypes::ByteArray Time); 55 | 56 | public: 57 | virtual int __fastcall Verify(void * InBuffer, int InSize, void * OutBuffer, int &OutSize)/* overload */; 58 | virtual int __fastcall VerifyDetached(void * Buffer, int Size, void * Signature, int SignatureSize)/* overload */; 59 | public: 60 | /* TElMessageVerifier.Create */ inline __fastcall virtual TElSMIMEMessageVerifier(Classes::TComponent* AOwner) : Sbmessages::TElMessageVerifier(AOwner) { } 61 | /* TElMessageVerifier.Destroy */ inline __fastcall virtual ~TElSMIMEMessageVerifier(void) { } 62 | 63 | 64 | /* Hoisted overloads: */ 65 | 66 | public: 67 | inline int __fastcall Verify(Classes::TStream* InStream, Classes::TStream* OutStream, __int64 InCount = 0x000000000){ return Sbmessages::TElMessageVerifier::Verify(InStream, OutStream, InCount); } 68 | inline int __fastcall VerifyDetached(Classes::TStream* InStream, Classes::TStream* SigStream, __int64 InCount = 0x000000000, __int64 SigCount = 0x000000000){ return Sbmessages::TElMessageVerifier::VerifyDetached(InStream, SigStream, InCount, SigCount); } 69 | 70 | }; 71 | 72 | typedef TElSMIMEMessageVerifier ElSMIMEMessageVerifier 73 | //-- var, const, procedure --------------------------------------------------- 74 | static const int SB_MESSAGE_ERROR_INVALID_MESSAGE_DIGEST = 8272; 75 | static const int SB_MESSAGE_WARNING_OMITTED_MESSAGE_DIGEST = 8273; 76 | 77 | } /* namespace Sbsmimesignatures */ 78 | using namespace Sbsmimesignatures; 79 | #pragma pack(pop) 80 | #pragma option pop 81 | 82 | #pragma delphiheader end. 83 | //-- end unit ---------------------------------------------------------------- 84 | #endif // SbsmimesignaturesHPP 85 | -------------------------------------------------------------------------------- /Sources/SBSRP.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsrp.pas' rev: 21.00 6 | 7 | #ifndef SbsrpHPP 8 | #define SbsrpHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | #include // Pascal unit 25 | 26 | //-- user supplied ----------------------------------------------------------- 27 | 28 | namespace Sbsrp 29 | { 30 | //-- type declarations ------------------------------------------------------- 31 | struct TSRPContext 32 | { 33 | 34 | public: 35 | Sbmath::TLInt *Salt; 36 | Sbmath::TLInt *A; 37 | Sbmath::TLInt *A_Small; 38 | Sbmath::TLInt *B; 39 | Sbmath::TLInt *B_Small; 40 | Sbmath::TLInt *V; 41 | Sbmath::TLInt *U; 42 | Sbmath::TLInt *N; 43 | Sbmath::TLInt *K; 44 | Sbmath::TLInt *G; 45 | Sbmath::TLInt *X; 46 | Sbmath::TLInt *S; 47 | bool Initialized; 48 | }; 49 | 50 | 51 | #pragma option push -b- 52 | enum TSSRPPrimeLen { sr1024, sr1536, sr2048, sr3072, sr4096, sr6144, sr8192 }; 53 | #pragma option pop 54 | 55 | //-- var, const, procedure --------------------------------------------------- 56 | extern PACKAGE int TSRPPrimesGen_1024; 57 | extern PACKAGE StaticArray TSRPPrimes_1024; 58 | static const ShortInt TSRPPrimesGen_1536 = 0x2; 59 | extern PACKAGE StaticArray TSRPPrimes_1536; 60 | static const ShortInt TSRPPrimesGen_2048 = 0x2; 61 | extern PACKAGE StaticArray TSRPPrimes_2048; 62 | static const ShortInt TSRPPrimesGen_3072 = 0x5; 63 | extern PACKAGE StaticArray TSRPPrimes_3072; 64 | static const ShortInt TSRPPrimesGen_4096 = 0x5; 65 | extern PACKAGE StaticArray TSRPPrimes_4096; 66 | static const ShortInt TSRPPrimesGen_6144 = 0x5; 67 | extern PACKAGE StaticArray TSRPPrimes_6144; 68 | static const ShortInt TSRPPrimesGen_8192 = 0x13; 69 | extern PACKAGE StaticArray TSRPPrimes_8192; 70 | extern PACKAGE void __fastcall SrpInitContext(TSRPContext &SRP); 71 | extern PACKAGE void __fastcall SrpDestroyContext(TSRPContext &SRP); 72 | extern PACKAGE void __fastcall SrpServerInit(TSRPContext &SRP); 73 | extern PACKAGE void __fastcall SrpGetU(Sbmath::PLInt N, Sbmath::PLInt A, Sbmath::PLInt B, System::UnicodeString Proto, Sbmath::PLInt &U); 74 | extern PACKAGE void __fastcall SrpGetA(System::UnicodeString UserName, System::UnicodeString UserPassword, TSRPContext &SRP); 75 | extern PACKAGE void __fastcall SrpGetClientX(System::UnicodeString User, System::UnicodeString Password, Sbmath::PLInt Salt, Sbmath::PLInt &ClX); 76 | extern PACKAGE void __fastcall SrpGetClientKey(TSRPContext &SRP); 77 | extern PACKAGE void __fastcall SrpGetServerKey(TSRPContext &SRP); 78 | extern PACKAGE void __fastcall SrpGetNewServerData(System::UnicodeString UserName, System::UnicodeString UserPassword, TSSRPPrimeLen PrimeLen, Sbtypes::ByteArray &N, Sbtypes::ByteArray &G, Sbtypes::ByteArray &Salt, Sbtypes::ByteArray &V); 79 | extern PACKAGE Sbtypes::ByteArray __fastcall LIntToBytes(Sbmath::PLInt I); 80 | extern PACKAGE void __fastcall LInitBytes(Sbmath::PLInt I, Sbtypes::ByteArray BA); 81 | 82 | } /* namespace Sbsrp */ 83 | using namespace Sbsrp; 84 | #pragma pack(pop) 85 | #pragma option pop 86 | 87 | #pragma delphiheader end. 88 | //-- end unit ---------------------------------------------------------------- 89 | #endif // SbsrpHPP 90 | -------------------------------------------------------------------------------- /Sources/SBSeed.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbseed.pas' rev: 21.00 6 | 7 | #ifndef SbseedHPP 8 | #define SbseedHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbseed 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | typedef unsigned UInt32; 26 | 27 | typedef __int64 UInt64; 28 | 29 | typedef StaticArray TSEEDKey; 30 | 31 | //-- var, const, procedure --------------------------------------------------- 32 | static const ShortInt SEED_ENCODE = 0x0; 33 | static const ShortInt SEED_DECODE = 0x1; 34 | extern PACKAGE void __fastcall SeedCoding(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, System::Byte const *Key, System::Byte Direction); 35 | 36 | } /* namespace Sbseed */ 37 | using namespace Sbseed; 38 | #pragma pack(pop) 39 | #pragma option pop 40 | 41 | #pragma delphiheader end. 42 | //-- end unit ---------------------------------------------------------------- 43 | #endif // SbseedHPP 44 | -------------------------------------------------------------------------------- /Sources/SBSerpent.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbserpent.pas' rev: 21.00 6 | 7 | #ifndef SbserpentHPP 8 | #define SbserpentHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | 20 | //-- user supplied ----------------------------------------------------------- 21 | 22 | namespace Sbserpent 23 | { 24 | //-- type declarations ------------------------------------------------------- 25 | typedef DynamicArray TSerpentKey; 26 | 27 | typedef StaticArray TSerpentBuffer; 28 | 29 | typedef StaticArray, 33> TSerpentExpandedKey; 30 | 31 | typedef TSerpentExpandedKey *PSerpentExpandedKey; 32 | 33 | typedef StaticArray TSerpentExpandedKeyEx; 34 | 35 | //-- var, const, procedure --------------------------------------------------- 36 | extern PACKAGE void __fastcall ExpandKey(const TSerpentKey Key, StaticArray *ExpandedKey); 37 | extern PACKAGE void __fastcall EncryptBlock(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, StaticArray const *ExpandedKey); 38 | extern PACKAGE void __fastcall DecryptBlock(unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3, StaticArray const *ExpandedKey); 39 | 40 | } /* namespace Sbserpent */ 41 | using namespace Sbserpent; 42 | #pragma pack(pop) 43 | #pragma option pop 44 | 45 | #pragma delphiheader end. 46 | //-- end unit ---------------------------------------------------------------- 47 | #endif // SbserpentHPP 48 | -------------------------------------------------------------------------------- /Sources/SBSharedResource.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsharedresource.pas' rev: 21.00 6 | 7 | #ifndef SbsharedresourceHPP 8 | #define SbsharedresourceHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbsharedresource 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS TElSharedResource; 30 | class PASCALIMPLEMENTATION TElSharedResource : public System::TObject 31 | { 32 | typedef System::TObject inherited; 33 | 34 | private: 35 | unsigned FActiveThreadID; 36 | int FActive; 37 | int FWaitingReaders; 38 | int FWaitingWriters; 39 | unsigned FSemReaders; 40 | unsigned FSemWriters; 41 | _RTL_CRITICAL_SECTION FCS; 42 | int FWriteDepth; 43 | bool FEnabled; 44 | 45 | public: 46 | __fastcall TElSharedResource(void); 47 | __fastcall virtual ~TElSharedResource(void); 48 | void __fastcall WaitToRead(void); 49 | void __fastcall WaitToWrite(void); 50 | void __fastcall Done(void); 51 | __property bool Enabled = {read=FEnabled, write=FEnabled, default=1}; 52 | }; 53 | 54 | 55 | //-- var, const, procedure --------------------------------------------------- 56 | 57 | } /* namespace Sbsharedresource */ 58 | using namespace Sbsharedresource; 59 | #pragma pack(pop) 60 | #pragma option pop 61 | 62 | #pragma delphiheader end. 63 | //-- end unit ---------------------------------------------------------------- 64 | #endif // SbsharedresourceHPP 65 | -------------------------------------------------------------------------------- /Sources/SBSocketTSPClient.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbsockettspclient.pas' rev: 21.00 6 | 7 | #ifndef SbsockettspclientHPP 8 | #define SbsockettspclientHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | #include // Pascal unit 24 | #include // Pascal unit 25 | #include // Pascal unit 26 | #include // Pascal unit 27 | #include // Pascal unit 28 | #include // Pascal unit 29 | #include // Pascal unit 30 | #include // Pascal unit 31 | #include // Pascal unit 32 | #include // Pascal unit 33 | #include // Pascal unit 34 | 35 | //-- user supplied ----------------------------------------------------------- 36 | 37 | namespace Sbsockettspclient 38 | { 39 | //-- type declarations ------------------------------------------------------- 40 | class DELPHICLASS TElSocketTSPClient; 41 | class PASCALIMPLEMENTATION TElSocketTSPClient : public Sbtspclient::TElCustomTSPClient 42 | { 43 | typedef Sbtspclient::TElCustomTSPClient inherited; 44 | 45 | protected: 46 | System::UnicodeString FAddress; 47 | int FPort; 48 | int FSocketTimeout; 49 | Sbsocket::TElSocket* FSocket; 50 | System::UnicodeString FErrorMessage; 51 | void __fastcall PrepareSocket(void); 52 | 53 | public: 54 | __fastcall virtual TElSocketTSPClient(Classes::TComponent* Owner); 55 | __fastcall virtual ~TElSocketTSPClient(void); 56 | virtual int __fastcall Timestamp(const Sbtypes::ByteArray HashedData, /* out */ Sbpkicommon::TSBPKIStatus &ServerResult, /* out */ int &FailureInfo, /* out */ Sbtypes::ByteArray &ReplyCMS); 57 | __property Sbsocket::TElSocket* Socket = {read=FSocket}; 58 | __property System::UnicodeString ErrorMessage = {read=FErrorMessage}; 59 | 60 | __published: 61 | __property System::UnicodeString Address = {read=FAddress, write=FAddress}; 62 | __property int Port = {read=FPort, write=FPort, nodefault}; 63 | __property int SocketTimeout = {read=FSocketTimeout, write=FSocketTimeout, nodefault}; 64 | }; 65 | 66 | 67 | //-- var, const, procedure --------------------------------------------------- 68 | extern PACKAGE void __fastcall Register(void); 69 | 70 | } /* namespace Sbsockettspclient */ 71 | using namespace Sbsockettspclient; 72 | #pragma pack(pop) 73 | #pragma option pop 74 | 75 | #pragma delphiheader end. 76 | //-- end unit ---------------------------------------------------------------- 77 | #endif // SbsockettspclientHPP 78 | -------------------------------------------------------------------------------- /Sources/SBStringList.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbstringlist.pas' rev: 21.00 6 | 7 | #ifndef SbstringlistHPP 8 | #define SbstringlistHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbstringlist 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | typedef Classes::TStringList ElStringList; 30 | 31 | typedef StaticArray TByteArrays; 32 | 33 | typedef TByteArrays *PByteArrayItem; 34 | 35 | class DELPHICLASS TElStringTokenizer; 36 | class PASCALIMPLEMENTATION TElStringTokenizer : public System::TObject 37 | { 38 | typedef System::TObject inherited; 39 | 40 | protected: 41 | int FPosition; 42 | bool FInQuote; 43 | bool FReturnEmptyTokens; 44 | System::UnicodeString FDelimiters; 45 | System::WideChar FEscapeChar; 46 | System::WideChar FOpeningQuote; 47 | System::WideChar FClosingQuote; 48 | System::UnicodeString FSourceString; 49 | bool FTrimQuotes; 50 | bool FTrimSpaces; 51 | bool __fastcall DoGetNext(bool CareForDelimiters, System::UnicodeString &Value); 52 | void __fastcall SetClosingQuote(const System::WideChar Value); 53 | void __fastcall SetReturnEmptyTokens(const bool Value); 54 | void __fastcall SetDelimiters(const System::UnicodeString Value); 55 | void __fastcall SetEscapeChar(const System::WideChar Value); 56 | void __fastcall SetOpeningQuote(const System::WideChar Value); 57 | void __fastcall SetSourceString(const System::UnicodeString Value); 58 | void __fastcall SetTrimQuotes(const bool Value); 59 | void __fastcall SetTrimSpaces(const bool Value); 60 | 61 | public: 62 | __fastcall TElStringTokenizer(void); 63 | Classes::TStringList* __fastcall GetAll(void)/* overload */; 64 | void __fastcall GetAll(Classes::TStringList* ResultList)/* overload */; 65 | bool __fastcall GetNext(System::UnicodeString &Value); 66 | bool __fastcall GetRest(System::UnicodeString &Value); 67 | void __fastcall Reset(void); 68 | __property System::WideChar ClosingQuote = {read=FClosingQuote, write=SetClosingQuote, nodefault}; 69 | __property bool ReturnEmptyTokens = {read=FReturnEmptyTokens, write=SetReturnEmptyTokens, nodefault}; 70 | __property System::UnicodeString Delimiters = {read=FDelimiters, write=SetDelimiters}; 71 | __property System::WideChar EscapeChar = {read=FEscapeChar, write=SetEscapeChar, nodefault}; 72 | __property System::WideChar OpeningQuote = {read=FOpeningQuote, write=SetOpeningQuote, nodefault}; 73 | __property System::UnicodeString SourceString = {read=FSourceString, write=SetSourceString}; 74 | __property bool TrimQuotes = {read=FTrimQuotes, write=SetTrimQuotes, nodefault}; 75 | __property bool TrimSpaces = {read=FTrimSpaces, write=SetTrimSpaces, nodefault}; 76 | public: 77 | /* TObject.Destroy */ inline __fastcall virtual ~TElStringTokenizer(void) { } 78 | 79 | }; 80 | 81 | 82 | //-- var, const, procedure --------------------------------------------------- 83 | 84 | } /* namespace Sbstringlist */ 85 | using namespace Sbstringlist; 86 | #pragma pack(pop) 87 | #pragma option pop 88 | 89 | #pragma delphiheader end. 90 | //-- end unit ---------------------------------------------------------------- 91 | #endif // SbstringlistHPP 92 | -------------------------------------------------------------------------------- /Sources/SBSystemStoreEditor.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicxor/cryptobboxvcl/cc0b6eeaadb2262458bf19bda30ac1e4ded21c99/Sources/SBSystemStoreEditor.dfm -------------------------------------------------------------------------------- /Sources/SBTimer.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbtimer.pas' rev: 21.00 6 | 7 | #ifndef SbtimerHPP 8 | #define SbtimerHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbtimer 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS TTimerThread; 30 | class PASCALIMPLEMENTATION TTimerThread : public Classes::TThread 31 | { 32 | typedef Classes::TThread inherited; 33 | 34 | private: 35 | unsigned FEvent; 36 | Classes::TNotifyEvent FOnTimer; 37 | Classes::TNotifyEvent FOnFinish; 38 | int FInterval; 39 | bool FTerminate; 40 | bool FEnabled; 41 | 42 | protected: 43 | void __fastcall DoTimer(void); 44 | void __fastcall SetInterval(int Interval); 45 | void __fastcall SetEnabled(bool Value); 46 | bool __fastcall GetEnabled(void); 47 | 48 | public: 49 | __fastcall TTimerThread(void); 50 | __fastcall virtual ~TTimerThread(void); 51 | virtual void __fastcall Execute(void); 52 | __property Classes::TNotifyEvent OnTimer = {read=FOnTimer, write=FOnTimer}; 53 | __property Classes::TNotifyEvent OnFinish = {read=FOnFinish, write=FOnFinish}; 54 | __property int Interval = {read=FInterval, write=SetInterval, nodefault}; 55 | __property bool TerminateNow = {read=FTerminate, write=FTerminate, nodefault}; 56 | __property bool Enabled = {read=GetEnabled, write=SetEnabled, nodefault}; 57 | }; 58 | 59 | 60 | class DELPHICLASS TElTimer; 61 | class PASCALIMPLEMENTATION TElTimer : public Classes::TComponent 62 | { 63 | typedef Classes::TComponent inherited; 64 | 65 | protected: 66 | Classes::TNotifyEvent FOnTimer; 67 | int FInterval; 68 | TTimerThread* FTimerThread; 69 | bool FRecreateThreads; 70 | Sbsharedresource::TElSharedResource* FTimerThreadCS; 71 | void __fastcall SetInterval(int Value); 72 | bool __fastcall GetEnabled(void); 73 | void __fastcall SetEnabled(bool Value); 74 | void __fastcall HandleTimerEvent(System::TObject* Sender); 75 | void __fastcall CreateTimerIfNeeded(void); 76 | void __fastcall KillTimer(void); 77 | 78 | public: 79 | __fastcall virtual TElTimer(Classes::TComponent* AOwner); 80 | __fastcall virtual ~TElTimer(void); 81 | __property int Interval = {read=FInterval, write=SetInterval, nodefault}; 82 | __property bool Enabled = {read=GetEnabled, write=SetEnabled, nodefault}; 83 | __property bool RecreateThreads = {read=FRecreateThreads, write=FRecreateThreads, nodefault}; 84 | 85 | __published: 86 | __property Classes::TNotifyEvent OnTimer = {read=FOnTimer, write=FOnTimer}; 87 | }; 88 | 89 | 90 | //-- var, const, procedure --------------------------------------------------- 91 | 92 | } /* namespace Sbtimer */ 93 | using namespace Sbtimer; 94 | #pragma pack(pop) 95 | #pragma option pop 96 | 97 | #pragma delphiheader end. 98 | //-- end unit ---------------------------------------------------------------- 99 | #endif // SbtimerHPP 100 | -------------------------------------------------------------------------------- /Sources/SBTwofish.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbtwofish.pas' rev: 21.00 6 | 7 | #ifndef SbtwofishHPP 8 | #define SbtwofishHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | 21 | //-- user supplied ----------------------------------------------------------- 22 | 23 | namespace Sbtwofish 24 | { 25 | //-- type declarations ------------------------------------------------------- 26 | struct TTwofishExpandedKey 27 | { 28 | 29 | public: 30 | StaticArray ExpandedKey; 31 | StaticArray SBoxKey; 32 | StaticArray SBox0; 33 | StaticArray SBox1; 34 | StaticArray SBox2; 35 | StaticArray SBox3; 36 | int KeyLen; 37 | }; 38 | 39 | 40 | //-- var, const, procedure --------------------------------------------------- 41 | extern PACKAGE void __fastcall EncryptBlock(const TTwofishExpandedKey &ExpandedKey, unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3); 42 | extern PACKAGE void __fastcall DecryptBlock(const TTwofishExpandedKey &ExpandedKey, unsigned &B0, unsigned &B1, unsigned &B2, unsigned &B3); 43 | extern PACKAGE void __fastcall ExpandKey(const Sbtypes::ByteArray Key, TTwofishExpandedKey &ExpandedKey); 44 | 45 | } /* namespace Sbtwofish */ 46 | using namespace Sbtwofish; 47 | #pragma pack(pop) 48 | #pragma option pop 49 | 50 | #pragma delphiheader end. 51 | //-- end unit ---------------------------------------------------------------- 52 | #endif // SbtwofishHPP 53 | -------------------------------------------------------------------------------- /Sources/SBUMAC.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbumac.pas' rev: 21.00 6 | 7 | #ifndef SbumacHPP 8 | #define SbumacHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | 23 | //-- user supplied ----------------------------------------------------------- 24 | 25 | namespace Sbumac 26 | { 27 | //-- type declarations ------------------------------------------------------- 28 | typedef __int64 UINT64; 29 | 30 | typedef System::Byte UINT8; 31 | 32 | typedef System::Word UINT16; 33 | 34 | typedef unsigned UINT32; 35 | 36 | typedef unsigned *pUINT32; 37 | 38 | typedef __int64 *pUINT64; 39 | 40 | typedef DynamicArray<__int64> UINT64Array; 41 | 42 | struct TNHContext 43 | { 44 | 45 | public: 46 | Sbtypes::ByteArray NH_Key; 47 | Sbtypes::ByteArray Data; 48 | int Next_Data_Empty; 49 | int Bytes_Hashed; 50 | UINT64Array State; 51 | }; 52 | 53 | 54 | #pragma pack(push,1) 55 | struct TUHASHContext 56 | { 57 | 58 | public: 59 | TNHContext Hash; 60 | UINT64Array Poly_Key_8; 61 | UINT64Array Poly_Accum; 62 | UINT64Array IP_Keys; 63 | Sbtypes::ByteArray IP_Trans; 64 | unsigned Msg_Len; 65 | }; 66 | #pragma pack(pop) 67 | 68 | 69 | #pragma pack(push,1) 70 | struct TPDFContext 71 | { 72 | 73 | public: 74 | Sbaes::TAESBuffer Cache; 75 | Sbaes::TAESBuffer Nonce; 76 | Sbaes::TAESExpandedKey128 PRF_Key; 77 | }; 78 | #pragma pack(pop) 79 | 80 | 81 | class DELPHICLASS TElUMAC; 82 | class PASCALIMPLEMENTATION TElUMAC : public System::TObject 83 | { 84 | typedef System::TObject inherited; 85 | 86 | protected: 87 | TUHASHContext fHash; 88 | TPDFContext fPDF; 89 | int fOutputLen; 90 | int fStreams; 91 | void __fastcall Initialize_UMAC(const Sbtypes::ByteArray Key, int TagLen); 92 | void __fastcall UHASH_Init(unsigned const *PRF_Key); 93 | void __fastcall Init_Members(void); 94 | __fastcall TElUMAC(void)/* overload */; 95 | 96 | public: 97 | __fastcall TElUMAC(const Sbtypes::ByteArray Key, int TagLen)/* overload */; 98 | __fastcall TElUMAC(const System::UnicodeString Key, int TagLen)/* overload */; 99 | __fastcall virtual ~TElUMAC(void); 100 | TElUMAC* __fastcall Clone(void); 101 | void __fastcall Reset(void); 102 | void __fastcall Update(const Sbtypes::ByteArray In_Buf, unsigned StartIndex, unsigned Len)/* overload */; 103 | void __fastcall Update(void * In_Buf, int Size)/* overload */; 104 | void __fastcall Final(const Sbtypes::ByteArray Nonce, /* out */ Sbtypes::ByteArray &Tag); 105 | void __fastcall Calculate(const Sbtypes::ByteArray In_Buf, unsigned StartIndex, unsigned Len, const Sbtypes::ByteArray Nonce, /* out */ Sbtypes::ByteArray &Tag)/* overload */; 106 | void __fastcall Calculate(void * In_Buf, unsigned Len, const Sbtypes::ByteArray Nonce, /* out */ Sbtypes::ByteArray &Tag)/* overload */; 107 | }; 108 | 109 | 110 | //-- var, const, procedure --------------------------------------------------- 111 | static const ShortInt AES_BLOCK_LEN = 0x10; 112 | static const ShortInt UMAC_KEY_LEN = 0x10; 113 | static const Word L1_KEY_LEN = 0x400; 114 | static const ShortInt L1_KEY_SHIFT = 0x10; 115 | static const ShortInt L1_PAD_BOUNDARY = 0x20; 116 | static const ShortInt HASH_BUF_BYTES = 0x40; 117 | 118 | } /* namespace Sbumac */ 119 | using namespace Sbumac; 120 | #pragma pack(pop) 121 | #pragma option pop 122 | 123 | #pragma delphiheader end. 124 | //-- end unit ---------------------------------------------------------------- 125 | #endif // SbumacHPP 126 | -------------------------------------------------------------------------------- /Sources/SBUnicode.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbunicode.pas' rev: 21.00 6 | 7 | #ifndef SbunicodeHPP 8 | #define SbunicodeHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbunicode 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | class DELPHICLASS TElUnicodeConverter; 30 | class PASCALIMPLEMENTATION TElUnicodeConverter : public Sbstrutils::TElStringConverter 31 | { 32 | typedef Sbstrutils::TElStringConverter inherited; 33 | 34 | protected: 35 | virtual void __fastcall SetDefCharset(const System::UnicodeString Value); 36 | 37 | public: 38 | __fastcall TElUnicodeConverter(void); 39 | __fastcall virtual ~TElUnicodeConverter(void); 40 | virtual Sbtypes::ByteArray __fastcall StrToUtf8(const System::UnicodeString Source); 41 | virtual System::UnicodeString __fastcall Utf8ToStr(const Sbtypes::ByteArray Source); 42 | virtual Sbtypes::ByteArray __fastcall StrToWideStr(const System::UnicodeString Source); 43 | virtual System::UnicodeString __fastcall WideStrToStr(const Sbtypes::ByteArray Source); 44 | }; 45 | 46 | 47 | //-- var, const, procedure --------------------------------------------------- 48 | extern PACKAGE Sbstrutils::TElStringConverter* __fastcall CreateUnicodeStringConverter(void); 49 | 50 | } /* namespace Sbunicode */ 51 | using namespace Sbunicode; 52 | #pragma pack(pop) 53 | #pragma option pop 54 | 55 | #pragma delphiheader end. 56 | //-- end unit ---------------------------------------------------------------- 57 | #endif // SbunicodeHPP 58 | -------------------------------------------------------------------------------- /Sources/SBWhirlpool.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbwhirlpool.pas' rev: 21.00 6 | 7 | #ifndef SbwhirlpoolHPP 8 | #define SbwhirlpoolHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | 19 | //-- user supplied ----------------------------------------------------------- 20 | 21 | namespace Sbwhirlpool 22 | { 23 | //-- type declarations ------------------------------------------------------- 24 | #pragma pack(push,1) 25 | struct TWhirlpoolContext 26 | { 27 | 28 | public: 29 | Sbtypes::ByteArray BitsHashed; 30 | Sbtypes::ByteArray Buffer; 31 | unsigned BufferSize; 32 | Sbtypes::Int64Array State; 33 | }; 34 | #pragma pack(pop) 35 | 36 | 37 | //-- var, const, procedure --------------------------------------------------- 38 | extern PACKAGE void __fastcall InitializeWhirlpool(TWhirlpoolContext &Context); 39 | extern PACKAGE void __fastcall HashWhirlpool(TWhirlpoolContext &Context, void * Chunk, unsigned ChunkSize)/* overload */; 40 | extern PACKAGE void __fastcall HashWhirlpool(TWhirlpoolContext &Context, Sbtypes::ByteArray Chunk, unsigned ChunkOffset, unsigned ChunkSize)/* overload */; 41 | extern PACKAGE Sbtypes::TMessageDigest512 __fastcall FinalizeWhirlpool(TWhirlpoolContext &Context); 42 | 43 | } /* namespace Sbwhirlpool */ 44 | using namespace Sbwhirlpool; 45 | #pragma pack(pop) 46 | #pragma option pop 47 | 48 | #pragma delphiheader end. 49 | //-- end unit ---------------------------------------------------------------- 50 | #endif // SbwhirlpoolHPP 51 | -------------------------------------------------------------------------------- /Sources/SBZUncompressUnit.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbzuncompressunit.pas' rev: 21.00 6 | 7 | #ifndef SbzuncompressunitHPP 8 | #define SbzuncompressunitHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | 23 | //-- user supplied ----------------------------------------------------------- 24 | 25 | namespace Sbzuncompressunit 26 | { 27 | //-- type declarations ------------------------------------------------------- 28 | #pragma pack(push,1) 29 | struct code 30 | { 31 | 32 | public: 33 | System::Byte op; 34 | System::Byte bits; 35 | unsigned val; 36 | }; 37 | #pragma pack(pop) 38 | 39 | 40 | typedef StaticArray TArrShr; 41 | 42 | typedef TArrShr *PArrShr; 43 | 44 | typedef StaticArray TArrShr288; 45 | 46 | typedef TArrShr *PArrShr288; 47 | 48 | typedef code *PCode; 49 | 50 | typedef StaticArray TArrCds; 51 | 52 | typedef TArrCds *PArrCds; 53 | 54 | typedef StaticArray TArrCds31; 55 | 56 | typedef TArrCds31 *PArrCds31; 57 | 58 | typedef StaticArray TArrCds511; 59 | 60 | typedef TArrCds511 *PArrCds511; 61 | 62 | #pragma option push -b- 63 | enum inflate_mode { HEAD, DICTID, DICT, TYPEB, TYPEDO, STORED, COPY, TABLE, LENLENS, CODELENS, LEN, LENEXT, DIST, DISTEXT, MATCH, LIT, CHECK, DONE, BAD, MEM, SYNC }; 64 | #pragma option pop 65 | 66 | struct inflate_state_s; 67 | typedef inflate_state_s *inflate_state; 68 | 69 | struct inflate_state_s 70 | { 71 | 72 | public: 73 | inflate_mode mode; 74 | int last; 75 | int wrap; 76 | int havedict; 77 | int flags; 78 | unsigned dmax; 79 | unsigned check; 80 | unsigned total; 81 | unsigned wbits; 82 | unsigned wsize; 83 | unsigned whave; 84 | unsigned Write; 85 | unsigned hold; 86 | unsigned bits; 87 | unsigned Length; 88 | unsigned offset; 89 | unsigned extra; 90 | char *window; 91 | TArrCds511 *lencode; 92 | TArrCds31 *distcode; 93 | unsigned lenbits; 94 | unsigned distbits; 95 | unsigned ncode; 96 | unsigned nlen; 97 | unsigned ndist; 98 | unsigned have; 99 | code *next; 100 | TArrShr lens; 101 | TArrShr288 work; 102 | TArrCds codes; 103 | }; 104 | 105 | 106 | //-- var, const, procedure --------------------------------------------------- 107 | static const Word MANY = 0x5a0; 108 | static const ShortInt DEF_WBITS = 0x10; 109 | static const ShortInt BMAX = 0xf; 110 | extern PACKAGE int __fastcall inflateEnd(Sbzcommonunit::TZStreamRec &z); 111 | extern PACKAGE int __fastcall inflateReset(Sbzcommonunit::TZStreamRec &z); 112 | extern PACKAGE int __fastcall inflateInit2_(Sbzcommonunit::TZStreamRec &z, int w, const Sbtypes::ByteArray version, int stream_size); 113 | extern PACKAGE int __fastcall inflateInit_(Sbzcommonunit::TZStreamRec &z, const Sbtypes::ByteArray version, int stream_size); 114 | extern PACKAGE int __fastcall uncompress(Sbzcommonunit::ArrayPtr &dest, unsigned &destLen, Sbzcommonunit::ArrayPtr source, unsigned sourceLen); 115 | extern PACKAGE int __fastcall inflate(Sbzcommonunit::TZStreamRec &z, int f); 116 | 117 | } /* namespace Sbzuncompressunit */ 118 | using namespace Sbzuncompressunit; 119 | #pragma pack(pop) 120 | #pragma option pop 121 | 122 | #pragma delphiheader end. 123 | //-- end unit ---------------------------------------------------------------- 124 | #endif // SbzuncompressunitHPP 125 | -------------------------------------------------------------------------------- /Sources/SBZlib.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sbzlib.pas' rev: 21.00 6 | 7 | #ifndef SbzlibHPP 8 | #define SbzlibHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sbzlib 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | struct TZlibContext 30 | { 31 | 32 | public: 33 | Sbzcommonunit::TZStreamRec strm; 34 | }; 35 | 36 | 37 | typedef bool __fastcall (__closure *TSBZLibOutputFunc)(void * Buffer, int Size, void * Param); 38 | 39 | //-- var, const, procedure --------------------------------------------------- 40 | extern PACKAGE void __fastcall InitializeCompression(TZlibContext &Context, int CompressionLevel); 41 | extern PACKAGE void __fastcall InitializeCompressionEx(TZlibContext &Context, int Level = 0x9)/* overload */; 42 | extern PACKAGE void __fastcall InitializeCompressionEx(TZlibContext &Context, int Level, int WindowBits)/* overload */; 43 | extern PACKAGE void __fastcall InitializeDecompressionEx(TZlibContext &Context, bool UseZLib = false); 44 | extern PACKAGE void __fastcall InitializeDecompressionEx64(TZlibContext &Context, bool UseZLib = false); 45 | extern PACKAGE void __fastcall Compress(TZlibContext &Context, void * InBuffer, unsigned InSize, void * OutBuffer, unsigned &OutSize); 46 | extern PACKAGE void __fastcall CompressEx(TZlibContext &Context, void * InBuffer, unsigned InSize, void * OutBuffer, unsigned &OutSize); 47 | extern PACKAGE void __fastcall InitializeDecompression(TZlibContext &Context); 48 | extern PACKAGE void __fastcall InitializeDecompression64(TZlibContext &Context); 49 | extern PACKAGE void __fastcall Decompress(TZlibContext &Context, void * InBuffer, unsigned InSize, void * OutBuffer, unsigned &OutSize); 50 | extern PACKAGE void __fastcall DecompressEx(TZlibContext &Context, void * InBuffer, unsigned InSize, TSBZLibOutputFunc OutputFunc, void * Param); 51 | extern PACKAGE void __fastcall FinalizeCompressionEx(TZlibContext &Context, void * OutBuffer, unsigned &OutSize); 52 | extern PACKAGE void __fastcall FinalizeDecompressionEx(TZlibContext &Context); 53 | 54 | } /* namespace Sbzlib */ 55 | using namespace Sbzlib; 56 | #pragma pack(pop) 57 | #pragma option pop 58 | 59 | #pragma delphiheader end. 60 | //-- end unit ---------------------------------------------------------------- 61 | #endif // SbzlibHPP 62 | -------------------------------------------------------------------------------- /Sources/SBlicenseManager.hpp: -------------------------------------------------------------------------------- 1 | // CodeGear C++Builder 2 | // Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc. 3 | // All rights reserved 4 | 5 | // (DO NOT EDIT: machine generated header) 'Sblicensemanager.pas' rev: 21.00 6 | 7 | #ifndef SblicensemanagerHPP 8 | #define SblicensemanagerHPP 9 | 10 | #pragma delphiheader begin 11 | #pragma option push 12 | #pragma option -w- // All warnings off 13 | #pragma option -Vx // Zero-length empty class member functions 14 | #pragma pack(push,8) 15 | #include // Pascal unit 16 | #include // Pascal unit 17 | #include // Pascal unit 18 | #include // Pascal unit 19 | #include // Pascal unit 20 | #include // Pascal unit 21 | #include // Pascal unit 22 | #include // Pascal unit 23 | 24 | //-- user supplied ----------------------------------------------------------- 25 | 26 | namespace Sblicensemanager 27 | { 28 | //-- type declarations ------------------------------------------------------- 29 | #pragma option push -b- 30 | enum TSBLicenseKeyRegKey { rkHK }; 31 | #pragma option pop 32 | 33 | class DELPHICLASS TElSBLicenseManager; 34 | class PASCALIMPLEMENTATION TElSBLicenseManager : public Classes::TComponent 35 | { 36 | typedef Classes::TComponent inherited; 37 | 38 | private: 39 | System::UnicodeString FLicenseKey; 40 | System::UnicodeString FLicenseKeyFile; 41 | HKEY FRegistryKey; 42 | void __fastcall SetLicenseKey(const System::UnicodeString Value); 43 | void __fastcall SetLicenseKeyFile(const System::UnicodeString Value); 44 | void __fastcall SetRegistryKey(HKEY Value); 45 | 46 | public: 47 | __fastcall virtual TElSBLicenseManager(Classes::TComponent* AOwner); 48 | __fastcall virtual ~TElSBLicenseManager(void); 49 | __property HKEY RegistryKey = {read=FRegistryKey, write=SetRegistryKey, nodefault}; 50 | 51 | __published: 52 | __property System::UnicodeString LicenseKey = {read=FLicenseKey, write=SetLicenseKey}; 53 | __property System::UnicodeString LicenseKeyFile = {read=FLicenseKeyFile, write=SetLicenseKeyFile}; 54 | }; 55 | 56 | 57 | typedef TElSBLicenseManager ElSBLicenseManager; 58 | 59 | //-- var, const, procedure --------------------------------------------------- 60 | extern PACKAGE void __fastcall Register(void); 61 | 62 | } /* namespace Sblicensemanager */ 63 | using namespace Sblicensemanager; 64 | #pragma pack(pop) 65 | #pragma option pop 66 | 67 | #pragma delphiheader end. 68 | //-- end unit ---------------------------------------------------------------- 69 | #endif // SblicensemanagerHPP 70 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | =============================================================================== 2 | CryptoBlackbox (c) EldoS Corporation 3 | =============================================================================== 4 | 5 | CryptoBlackbox is a free package of SecureBlackbox product. 6 | 7 | Use of CryptoBlackbox is governed by the license available on 8 | https://www.eldos.com/licenses/dev-free.php?PRODUCT=CryptoBlackbox 9 | 10 | CryptoBlackbox contains symmetric and PKI-based cryptographic functions, X.509 11 | certificate management, TSP and OCSP clients and PKCS#7/CMS encryption and data 12 | signing functionality. 13 | 14 | Help file is available for a separate download on 15 | https://www.eldos.com/sbb/download-release.php 16 | 17 | For support options see https://www.eldos.com/sbb/support-tech.php 18 | 19 | --------------------------------------------------------------------------------