Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stMPPKTypes

Classes, interfaces and records

interfaceiKeyAndCertStore

function StorePrivateKey(const aPassword : iSecretKey; const aKey : iUnknown; const aFriendlyName, aProviderName : UnicodeString; const aLocalKeyID : OctetString; aCompatibility: Boolean = True) : Boolean; function StoreCertificate(const aPassword : iSecretKey; const aCert : iUnknown; const aFriendlyName: UnicodeString; const aLocalKeyID : OctetString) : Boolean; function StoreCRL(const aPassword : iSecretKey; const aCRL : iUnknown; const aFriendlyName: UnicodeString; const aLocalKeyID : OctetString) : Boolean; function CopyTo(const aDest : iKeyAndCertStore; const aSrcPwd: iSecretKey; const aDstPwd: iSecretKey) : Boolean;

interfaceiMPPK

inherits from iKey

function GetData: iUnknown; procedure SetData(const Value: iUnknown); function GetPKI: OctetString; function GetPKI2: OctetString; function GetSignatureDigestAlg: tHashAlgorithm; function GetSignatureLength: Integer; procedure SetSignatureDigestAlg(const Value: tHashAlgorithm); property PublicKeyIdentifier: OctetString read GetPKI; property PublicKeyIdentifier2: OctetString read GetPKI2; property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg; property SignatureLength: Integer read GetSignatureLength; property Data: iUnknown read GetData write SetData;

interfaceiMPPublicKey

inherits from iMPPK

function EncryptKeyTransport(const aKey : tBytes; aKeyOffset, aKeyLen : Integer; var aEMsg : tBytes; aMsgOffset, aMsgLen : Integer) : Boolean; overload; function EncryptKeyTransport(const aKey : tBytes; aKeyOffset, aKeyLen : Integer; var aEMsg : tBytes) : Boolean; overload; function VerBuf(const aMsg : tBytes; aMsgOffset, aMsgLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean; function VerDig(const aDigest : tBytes; aDigestOffset, aDigestLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean;

interfaceiSignPublicKey

function GetData: iUnknown; procedure SetData(const Value: iUnknown); function GetSignatureDigestAlg: tHashAlgorithm; procedure SetSignatureDigestAlg(const Value: tHashAlgorithm); function VerBuf(const aMsg : tBytes; aMsgOffset, aMsgLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean; function VerDig(const aDigest : tBytes; aDigestOffset, aDigestLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean; property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg; property Data: iUnknown read GetData write SetData;

interfaceiSignKey

function GetData: iUnknown; procedure SetData(const Value: iUnknown); function GetSignatureDigestAlg: tHashAlgorithm; procedure SetSignatureDigestAlg(const Value: tHashAlgorithm); property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg; property Data: iUnknown read GetData write SetData;

interfaceiSignKeyDL

inherits from iSignKey

function GetDEREncode: Boolean; procedure SetDEREncode(Value: Boolean); property DEREncode: Boolean read GetDEREncode write SetDEREncode;

interfaceiSignPublicKeyDL

inherits from iSignPublicKey

function GetDEREncode: Boolean; procedure SetDEREncode(Value: Boolean); property DEREncode: Boolean read GetDEREncode write SetDEREncode;

interfaceiSignPublicKeyIF

inherits from iSignPublicKey

function GetMGFHashAlg: tHashAlgorithm; function GetSignEncoding: tSignEncoding; procedure SetMGFHashAlg(Value: tHashAlgorithm); procedure SetSignEncoding(Value: tSignEncoding); function GetEncryptEncoding: tEncryptEncoding; procedure SetEncryptEncoding(Value: tEncryptEncoding); property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg; property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding; property EncryptEncoding: tEncryptEncoding read GetEncryptEncoding write SetEncryptEncoding;

interfaceiSignKeyIF

inherits from iSignKey

function GetMGFHashAlg: tHashAlgorithm; procedure SetMGFHashAlg(Value: tHashAlgorithm); function GetSignEncoding: tSignEncoding; procedure SetSignEncoding(Value: tSignEncoding); function GetEncryptEncoding: tEncryptEncoding; procedure SetEncryptEncoding(Value: tEncryptEncoding); property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg; property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding; property EncryptEncoding: tEncryptEncoding read GetEncryptEncoding write SetEncryptEncoding;

interfaceiSignPrivateKey

function GetData: iUnknown; procedure SetData(const Value: iUnknown); function GetSignatureDigestAlg: tHashAlgorithm; procedure SetSignatureDigestAlg(const Value: tHashAlgorithm); function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer) : Integer; overload; function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer; aHashAlg: tHashAlgorithm = haDefault) : Integer; overload; function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes) : Integer; overload; function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aHashAlg: tHashAlgorithm = haDefault) : Integer; overload; function Validate(const aPublicKey: iUnknown): Boolean; procedure SetAttributes(const aPublicKey: iUnknown); property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg; property Data: iUnknown read GetData write SetData;

interfaceiSignPrivateKeyDL

inherits from iSignPrivateKey

function GetDEREncode: Boolean; procedure SetDEREncode(Value: Boolean); property DEREncode: Boolean read GetDEREncode write SetDEREncode;

interfaceiSignPrivateKeyIF

inherits from iSignPrivateKey

function GetMGFHashAlg: tHashAlgorithm; function GetSignEncoding: tSignEncoding; procedure SetMGFHashAlg(Value: tHashAlgorithm); procedure SetSignEncoding(Value: tSignEncoding); property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg; property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding;

interfaceiPKPublicKeyInfo

function AlgorithmIdentifier: ObjectIdentifier; function PublicKeyIdentifier: OctetString;

interfaceiSsMPDLArith

(no public members)

interfaceiDLKey

function GetParams: iDiscreteLogField; function GetPool: iSsMPDLArith; function GetSignScheme: tDLSignatureScheme; procedure SetSignScheme(const Value: tDLSignatureScheme); property Pool: iSsMPDLArith read GetPool; property SignScheme: tDLSignatureScheme read GetSignScheme write SetSignScheme; property Params: iDiscreteLogField read GetParams;

interfaceiDLPublicKey

inherits from iDLKey

function GetW: iFieldElement; procedure SetW(Value: iFieldElement); function Validate: Boolean; property W: iFieldElement read GetW write SetW;

interfaceiDLPrivateKey

inherits from iDLKey

function GetS: iMPInteger; procedure SetS(Value: iMPInteger); function NewKeys(Params: iDiscreteLogField; aPubl: iFieldElement = nil): iFieldElement; overload; function PublicKey(aPubl: iFieldElement = nil): iFieldElement; overload; procedure PublicKey(var aPubl: iDLPublicKey); overload; function Validate(aPubl: iDLPublicKey): Boolean; property S: iMPInteger read GetS write SetS;

interfaceiX9_42MacTagParams

function GetAlgorithmID: iSecretKey; function GetCounter: UInt32; function GetIdA: iSecretKey; function GetIdB: iSecretKey; function GetMacTag: iSecretKey; function GetMacTagLen: Integer; function GetTA: iFieldElement; function GetTB: iFieldElement; function GetYA: iFieldElement; function GetYB: iFieldElement; procedure SetAlgorithmID(const Value: iSecretKey); procedure SetCounter(const Value: UInt32); procedure SetIdA(const Value: iSecretKey); procedure SetIdB(const Value: iSecretKey); procedure SetMacTag(const Value: iSecretKey); procedure SetMacTagLen(const Value: Integer); procedure SetTA(const Value: iFieldElement); procedure SetTB(const Value: iFieldElement); procedure SetYA(const Value: iFieldElement); procedure SetYB(const Value: iFieldElement); property AlgorithmID: iSecretKey read GetAlgorithmID write SetAlgorithmID; property Counter: UInt32 read GetCounter write SetCounter; property IdA: iSecretKey read GetIdA write SetIdA; property IdB: iSecretKey read GetIdB write SetIdB; property YA: iFieldElement read GetYA write SetYA; property YB: iFieldElement read GetYB write SetYB; property TA: iFieldElement read GetTA write SetTA; property TB: iFieldElement read GetTB write SetTB; property MacTag: iSecretKey read GetMacTag write SetMacTag; property MacTagLen: Integer read GetMacTagLen write SetMacTagLen;

interfaceiMPPrivateKey

inherits from iMPPK

function Clone: iMPPrivateKey; function DecryptKeyAgreement(aPublKey: iDLPublicKey; var aSecret : tBytes; aSOffset: Integer; aSLen : Integer) : Boolean; overload; function DecryptKeyTransport(const aEMsg : tBytes; aEOffset: Integer; aELen : Integer; const aKey : tBytes; aKOffset: Integer; aKLen : Integer) : Boolean; function GetTLS: Boolean; procedure SetTLS(const Value: Boolean); function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer) : Integer; function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer; aHashAlg: tHashAlgorithm = haDefault) : Integer; property TLS: Boolean read GetTLS write SetTLS;

interfaceiMPKAPrivateKey

inherits from iMPPrivateKey

function GetSystemParams: iDiscreteLogField; function GetCoFactor: Boolean; function GetDEREncodeSignature: Boolean; function GetKAHashAlg: tHashAlgorithm; function GetKDF: tKeyDerivation; function GetP: iSecretKey; procedure SetCoFactor(const Value: Boolean); procedure SetDEREncodeSignature(const Value: Boolean); procedure SetKAHashAlg(const Value: tHashAlgorithm); procedure SetKDF(const Value: tKeyDerivation); procedure SetP(const Value: iSecretKey); function DLPublicKey(var aPublKey: iDLPublicKey): Boolean; property SystemParams: iDiscreteLogField read GetSystemParams; property CoFactor: Boolean read GetCoFactor write SetCoFactor; property DEREncodeSignature: Boolean read GetDEREncodeSignature write SetDEREncodeSignature; property KAHashAlg: tHashAlgorithm read GetKAHashAlg write SetKAHashAlg; property KDF: tKeyDerivation read GetKDF write SetKDF; property P: iSecretKey read GetP write SetP;

interfaceiKeyExchange

function GetHashAlgorithm: tHashAlgorithm; function GetKDFParameter: iSecretKey; function GetKeyDerivation: tKeyDerivation; function GetSecretKeyLen: Integer; function GetAlgorithmID: ObjectIdentifier; procedure SetHashAlgorithm(const Value: tHashAlgorithm); procedure SetKeyDerivation(const Value: TKeyDerivation); procedure SetSecretKeyLen(const Value: Integer); procedure SetKDFParameter(const Value: iSecretKey); procedure SetAlgorithmID(const Value: ObjectIdentifier); property HashAlgorithm: tHashAlgorithm read GetHashAlgorithm write SetHashAlgorithm; property KeyDerivation: tKeyDerivation read GetKeyDerivation write SetKeyDerivation; property KDFParameter: iSecretKey read GetKDFParameter write SetKDFParameter; property SecretKeyLen: Integer read GetSecretKeyLen write SetSecretKeyLen; property AlgorithmID: ObjectIdentifier read GetAlgorithmID write SetAlgorithmID;

classtSsKeyExchange

inherits from tObjectMapping

implements iKeyExchange

constructor Create;

interfaceiSsMPDLArith

inherits from iBasicMPArith

function GetInstance: tSsAbstractMPArith; function NewPrivateKey: iDLPrivateKey; function NewPublicKey: iDLPublicKey; function FieldElementToBytes(aElement: iFieldElement; aParams : iDiscreteLogField) : tBytes; overload; function FieldElementToBytes(aElement : iFieldElement; aParams : iDiscreteLogField; const aDst : tBytes; aDstOffset: Integer; var aDstCount : Integer) : Boolean; overload; function BytesToFieldElement(const aSrc : tBytes; aParams: iDiscreteLogField) : iFieldElement; overload; function BytesToFieldElement(const aSrc : tBytes; aSrcOffset, aSrcCount : Integer; aParams : iDiscreteLogField) : iFieldElement; overload; function KeyAgreementScheme_DH1(aPriv : iDLPrivateKey; WPr : iFieldElement; P : iSecretKey; CoFactor : Boolean; HashAlgorithm: tHashAlgorithm; KeyDerivation: tKeyDerivation; kLen : Integer; var K : iSecretKey; MacTag1 : iX9_42MacTagParams = nil; MacTag2 : iX9_42MacTagParams = nil) : Boolean; function KeyAgreementScheme_DH2(aPriv0 : iDLPrivateKey; aPriv1 : iDLPrivateKey; WPr : iFieldElement; VPr : iFieldElement; P : iSecretKey; CoFactor0, CoFactor1 : Boolean; HashAlgorithm: tHashAlgorithm; KeyDerivation: tKeyDerivation; kLen : Integer; var K : iSecretKey; function KeyAgreementScheme_MQV(aPriv0 : iDLPrivateKey; aPriv1 : iMPInteger; aPubl1 : iFieldElement; WPr : iFieldElement; VPr : iFieldElement; P : iSecretKey; CoFactor : Boolean; HashAlgorithm: tHashAlgorithm; KeyDerivation: TKeyDerivation; kLen : Integer; var K : iSecretKey; function EncodingMethodForSignatureWithAppendix1(const Digest : tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; FBitSize : Cardinal; F : iMPInteger = nil) : iMPInteger; function DecodingMethodForSignatureWithAppendix1(F : iMPInteger; const Digest : tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; FBitSize : Cardinal) : Boolean; function SSASignatureGeneration(aKey : iDLPrivateKey; const Digest : tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean; DEREncode : Boolean; const Sign : tBytes; SignOffset, SignCount : Integer) : Integer; overload; function SSASignatureGeneration(aKey : iDLPrivateKey; const Digest : tBytes; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean; DEREncode : Boolean; var Sign : tBytes) : Integer; overload; function SSASignatureGeneration(aKey : iDLPrivateKey; Digest : iSecretKey; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean; DEREncode : Boolean; var Sign : iSecretKey) : Integer; overload; function SSASignatureGeneration(aKey : iDLPrivateKey; const Msg : tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; DEREncode : Boolean; const Sign : tBytes; SignOffset, SignCount : Integer) : Integer; overload; function SSASignatureGeneration(aKey : iDLPrivateKey; const Msg : tBytes; HashAlgorithm: tHashAlgorithm; DEREncode : Boolean; var Sign : tBytes) : Integer; overload; function SSASignatureVerification(aKey : iDLPublicKey; const Digest : tBytes; DOffset, DCount : Integer; const Sign : tBytes; SOffset, SCount : Integer; DEREncode : Boolean; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean) : Boolean; overload; function SSASignatureVerification(aKey : iDLPublicKey; const Digest : tBytes; const Sign : tBytes; DEREncode : Boolean; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean) : Boolean; overload; function SSASignatureVerification(aKey : iDLPublicKey; Digest : iSecretKey; Sign : iSecretKey; DEREncode : Boolean; HashAlgorithm: tHashAlgorithm; NullMsg : Boolean) : Boolean; overload; function SSASignatureVerification(aKey : iDLPublicKey; const Msg : tBytes; MOffset, MCount : Integer; const Sign: tBytes; SOffset, SCount : Integer; DEREncode : Boolean; HashAlgorithm: tHashAlgorithm) : Boolean; overload; function SSASignatureVerification(aKey : iDLPublicKey; const Msg : tBytes; const Sign : tBytes; DEREncode : Boolean; HashAlgorithm: tHashAlgorithm) : Boolean; overload; procedure IntegratedEncryption(aKey : iDLPublicKey; const Msg : tBytes; MsgOffset, MsgCount : Integer; const P1 : tBytes; P1Offset, P1Len : Integer; const P2 : tBytes; P2Offset, P2Len : Integer; HashAlgorithm: tHashAlgorithm; procedure IntegratedEncryption(aKey: iDLPublicKey; const Msg: tBytes; MsgOffset, MsgCount: Integer; const P1: tBytes; P1Offset, P1Len: Integer; const P2: tBytes; P2Offset, P2Len: Integer; HashAlgorithm: tHashAlgorithm; CipherClass: TCipherClass; KeyLen: Integer; var EphemeralKey: iFieldElement; var CipherText: tBytes; var MAC: tBytes); overload; function IntegratedDecryption(aKey: iDLPrivateKey; EphemeralKey: iFieldElement; const CipherText: tBytes; CTOffset, CTCount: Integer; const MAC: tBytes; MACOffset, MACCount: Integer; const P1: tBytes; P1Offset, P1Len: Integer; const P2: tBytes; P2Offset, P2Len: Integer; HashAlgorithm: tHashAlgorithm; const Msg: tBytes; MsgOffset: Integer; var MsgCount: Integer): Boolean; overload; function IntegratedDecryption(aKey: iDLPrivateKey; EphemeralKey: iFieldElement; const CipherText: tBytes; CTOffset, CTCount: Integer; const MAC: tBytes; MACOffset, MACCount: Integer; const P1: tBytes; P1Offset, P1Len: Integer; const P2: tBytes; P2Offset, P2Len: Integer; HashAlgorithm: tHashAlgorithm; CipherClass: TCipherClass; KeyLen: Integer; const Msg: tBytes; MsgOffset: Integer; var MsgCount: Integer): Boolean; overload; procedure NewKeys(aParams: iDiscreteLogField; var aPriv : iMPInteger; var aPubl : iFieldElement); overload; procedure NewKeys(aParams: iDiscreteLogField; var aPriv : iDLPrivateKey; var aPubl : iFieldElement); overload; procedure KDF1(const Z : tBytes; zOffset, zLen: Integer; const P : tBytes; pOffset, pLen: Integer; HashAlgorithm: tHashAlgorithm; const K: tBytes; kOffset, kLen: Integer); overload; function KDF1(Z : iSecretKey; P : iSecretKey; HashAlgorithm: tHashAlgorithm; kLen : Integer) : iSecretKey; overload; procedure KDF2(const Z : tBytes; zOffset, zLen: Integer; const P : tBytes; pOffset, pLen: Integer; HashAlgorithm: tHashAlgorithm; const K : tBytes; kOffset, kLen: Integer); overload; function KDF2(const Z : tBytes; zOffset, zLen: Integer; const P : tBytes; pOffset, pLen: Integer; HashAlgorithm: tHashAlgorithm; kLen : Integer) : iSecretKey; overload; function KDF2(Z : iSecretKey; P : iSecretKey; HashAlgorithm: tHashAlgorithm; kLen : Integer) : iSecretKey; overload; procedure KDFX9_42ASN1BER(const Z : tBytes; zOffset, zLen: Integer; const P : tBytes; pOffset, pLen: Integer; HashAlgorithm: tHashAlgorithm; const K : tBytes; kOffset, kLen: Integer); overload; function KDFX9_42ASN1BER(Z : iSecretKey; P : iSecretKey; HashAlgorithm: tHashAlgorithm; kLen : Integer) : iSecretKey; overload; procedure KDFX9_42Concatenation(const Z : tBytes; zOffset, zLen: Integer; const P : tBytes; pOffset, pLen: Integer; HashAlgorithm: tHashAlgorithm; const K : tBytes; kOffset, kLen: Integer); overload; function KDFX9_42Concatenation(Z : iSecretKey; P : iSecretKey; HashAlgorithm: tHashAlgorithm; kLen : Integer) : iSecretKey; overload;

interfaceiSsMPEC

inherits from iSsMPDLArith

function OIDToCurve(const aOID : ObjectIdentifier; var aCurve: iECurve) : Boolean;

interfaceiSsMPFF

inherits from iSsMPDLArith

procedure NewKeys(aBitSize : Cardinal; aQBitSize : Cardinal; var aPriv : iDLPrivateKey; var aPubl : iDLPublicKey; aTerminate: tGetTerminate = nil); overload;

interfaceiSsMPIF

(no public members)

interfaceiIFKey

function GetPool: iSsMPIF; function GetScheme: tIFScheme; function GetN: iMPInteger; function GetE: iMPInteger; procedure SetScheme(Value: tIFScheme); procedure SetN(Value: iMPInteger); procedure SetE(Value: iMPInteger); property Pool: iSsMPIF read GetPool; property Scheme: tIFScheme read GetScheme write SetScheme; property N: iMPInteger read GetN write SetN; property E: iMPInteger read GetE write SetE;

interfaceiIFPrivateKey

(no public members)

interfaceiIFPublicKey

inherits from iIFKey

function IFEP_RSA(F: iMPInteger; G: iMPInteger = nil): iMPInteger; function Validate(APriv: iIFPrivateKey): Boolean;

classtExternalIFPrivateKey

function GetIdentifier: string; virtual;
Always returns an empty string.
function GetKeySize: Integer; virtual;
Always returns -1.
function IFPrivateKeyOperation(I: iMPInteger; var J: iMPInteger): Boolean; virtual;
Always returns False.
function SignMsg(const Msg: tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding: tSignEncoding; var Sign: tBytes; var SignCount: Integer): Boolean; virtual;
Always returns False.
function SignDigest(const Digest: tBytes; Offset, Count: Integer; HashAlgorithm: tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding: tSignEncoding; NullMsg: Boolean; var Sign: tBytes; var SignCount: Integer): Boolean; virtual;
Always returns False.
function IFESDecryption(const EMsg: tBytes; EOffset, ECount: Integer; const P: tBytes; POffset, PCount: Integer; HashAlgorithm: tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; EncryptEncoding: tEncryptEncoding; var Msg: tBytes; var Success: Boolean): Boolean; virtual;
Always returns False.
function Validate(APubl: iIFPublicKey): Boolean; virtual;
Always returns False.
constructor Create; virtual; function ImportKey(const PKIdentifier; PKILen: Integer): Boolean; virtual;
Always returns False.
property Identifier: string read GetIdentifier;

interfaceiIFPrivateKey

inherits from iIFKey

function GetReprType: Byte; function GetD: iMPInteger; function GetP: iMPInteger; function GetQ: iMPInteger; function GetD1: iMPInteger; function GetD2: iMPInteger; function GetC: iMPInteger; function GetExtKey: tExternalIFPrivateKey; procedure SetReprType(const Value: Byte); procedure SetD(Value: iMPInteger); procedure SetP(Value: iMPInteger); procedure SetQ(Value: iMPInteger); procedure SetD1(Value: iMPInteger); procedure SetD2(Value: iMPInteger); procedure SetC(Value: iMPInteger); procedure SetExtKey(Value: tExternalIFPrivateKey); procedure IFRSAKeys(aBitSize : Cardinal; aReprType : Byte; aStrongPrimes: Boolean; var aPubl : iIFPublicKey; Exportable : Boolean; aTerminate : tGetTerminate = nil); procedure IFRSAPublicKey(var APubl: iIFPublicKey; Compatibility: Boolean); procedure IFRWKeys(ABitSize: Cardinal; AReprType: Byte; AStrongPrimes: Boolean; var APubl: iIFPublicKey); function IFPrivateKeyOperation(I: iMPInteger; J: iMPInteger = nil): iMPInteger; function Validate(APubl: iIFPublicKey): Boolean; property ReprType: Byte read GetReprType write SetReprType; property D: iMPInteger read GetD write SetD; property P: iMPInteger read GetP write SetP; property Q: iMPInteger read GetQ write SetQ; property D1: iMPInteger read GetD1 write SetD1; property D2: iMPInteger read GetD2 write SetD2; property C: iMPInteger read GetC write SetC; property ExternalKey: tExternalIFPrivateKey read GetExtKey write SetExtKey;

interfaceiTrailerField

function GetAllowTrailerField: tTrailerFields; function GetUseTrailerField: tTrailerFields; procedure SetAllowTrailerField(Value: tTrailerFields); procedure SetUseTrailerField(Value: tTrailerFields); property AllowTrailerField: tTrailerFields read GetAllowTrailerField write SetAllowTrailerField; property UseTrailerField: tTrailerFields read GetUseTrailerField write SetUseTrailerField;

interfaceiSsMPIF

inherits from iBasicMPArith

function NewPrivateKey: iIFPrivateKey; function NewPrivateKeyFrom(aSource: iIFPrivateKey): iIFPrivateKey; function NewPublicKey: iIFPublicKey; function GetEncodingRangeEME1(aKeyBits : Cardinal; aHashAlgorithm: tHashAlgorithm; var MaxBytes : Integer) : Boolean; function GetEncodingRangeEME_PKCS1_v1_5(aKeyBits: Cardinal; var MaxBytes: Integer) : Boolean; procedure RSAKeys(aBitSize : Cardinal; aReprType : Byte; aStrongPrimes: Boolean; var aPriv : iIFPrivateKey; var aPubl : iIFPublicKey; Exportable : Boolean = False; aTerminate : tGetTerminate = nil); procedure RSAPublicKey(const aPriv : iIFPrivateKey; var aPubl : iIFPublicKey; Compatibility: Boolean = False); procedure RWKeys(aBitSize : Cardinal; aReprType : Byte; aStrongPrimes: Boolean; var aPriv : iIFPrivateKey; var aPubl : iIFPublicKey); function ValidatePrivateKey(aPriv: iIFPrivateKey; aPubl: iIFPublicKey) : Boolean; function SSASignatureGeneration(aKey : iIFPrivateKey; const Digest : tBytes; Offset, Count : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; NullMsg : Boolean; var Sign : tBytes) : Integer; overload;
Usage: AKey.Scheme = ifRSA1, Encoding = seEMSA3: RSA-PKCS-v1.5 AKey.Scheme = ifRSA1, Encoding = seEMSA4: RSA-PSS
function SSASignatureGeneration(aKey : iIFPrivateKey; const Digest : tBytes; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; NullMsg : Boolean; var Sign : tBytes) : Integer; overload; function SSASignatureGeneration(aKey : iIFPrivateKey; const Msg : tBytes; Offset, Count : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; var Sign : tBytes) : Integer; overload; function SSASignatureGeneration(aKey : iIFPrivateKey; const Msg : tBytes; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; var Sign : tBytes) : Integer; overload; function SSASignatureVerification(aKey : iIFPublicKey; const Digest : tBytes; DOffset, DCount : Integer; const Sign : tBytes; SOffset, SCount : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; NullMsg : Boolean) function SSASignatureVerification(aKey : iIFPublicKey; const Digest : tBytes; const Sign : tBytes; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding; NullMsg : Boolean) : Boolean; overload; function SSASignatureVerification(aKey : iIFPublicKey; const Msg : tBytes; MOffset, MCount : Integer; const Sign : tBytes; SOffset, SCount : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding) : Boolean; overload; function SSASignatureVerification(aKey : iIFPublicKey; const Msg : tBytes; const Sign : tBytes; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; Encoding : tSignEncoding) : Boolean; overload; procedure Encryption(aKey : iIFPublicKey; const Msg : tBytes; MOffset, MCount : Integer; const P : tBytes; POffset, PCount : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; EncryptEncoding : tEncryptEncoding; var EMsg : tBytes); overload;
EncryptEncoding = eeEME1 : OAEP EncryptEncoding = eeEME_PKCS1_v1_5: PKCS#1 v1.5
procedure Encryption(aKey : iIFPublicKey; const Msg : tBytes; Offset, Count : Integer; HashAlgorithm : tHashAlgorithm; EncryptEncoding: tEncryptEncoding; var EMsg : tBytes); overload; function Decryption(aKey : iIFPrivateKey; const EMsg : tBytes; EOffset, ECount : Integer; const P : tBytes; POffset, PCount : Integer; HashAlgorithm : tHashAlgorithm; MGFHashAlgorithm: tHashAlgorithm; EncryptEncoding : tEncryptEncoding; var Msg : tBytes) function Decryption(aKey : iIFPrivateKey; const EMsg : tBytes; Offset, Count : Integer; HashAlgorithm : tHashAlgorithm; EncryptEncoding: tEncryptEncoding; var Msg : tBytes) : Boolean; overload; function Decryption(aKey : iIFPrivateKey; const EMsg : tBytes; Offset, Count : Integer; HashAlgorithm : tHashAlgorithm; EncryptEncoding: tEncryptEncoding; var Msg : iSecretKey) : Boolean; overload; function SignatureAlgEMSA3(HA: tHashAlgorithm): ObjectIdentifier; function ExtractHashAlgEMSA3(OID: ObjectIdentifier; var HA: tHashAlgorithm): Boolean;

interfaceiMPKeyList

function GetKeyCount: Integer; function GetKeys(aIndex: Integer): iUnknown; function AddKey(const aKey: iUnknown): Integer; function AddKeyIntf(const aKey: iUnknown; const aIID: TGUID): Integer; procedure Delete(aIndex: Integer); property KeyCount: Integer read GetKeyCount; property Keys[aIndex: Integer]: iUnknown read GetKeys;

classtAbstractMPPrivateKey

inherits from TInterfacedObject

implements iMPPK, iMPPrivateKey

constructor Create(const aPublicKey: iMPPublicKey);

classtMPPrivateKeyIF

inherits from tAbstractMPPrivateKey

tMPIFPrivateKeyIF is a wrapper for iIFPrivateKey. tMPIFPrivateKeyIF implements the iMPPrivateKey interface. The methods and properties of this class defaults to use the properties of the *public* key that is passed to the constructor. Furthermore, the parameters that are used for RSA signing/verification and encryption/decryption are specific to the tMPIFPrivateKeyIF instance and are NOT reflected by the properties of the wrapped iIPPrivateKey instance. This makes makes it thread safe to use instances of this class even if the wrapped iIFPrivateKey is shared by multiple threads.

constructor Create(const aKey : iIFPrivateKey; const aPublicKey: iMPPublicKey);

classtMPPrivateKeyDL

constructor Create(const aKey : iDLPrivateKey; const aPublicKey: iMPPublicKey);

Types (enumerations, sets, aliases)

enumtUseAlgorithm

  tUseAlgorithm = (uaDefault,uaTargetSpecified,uaSourceSpecified);

enumtIFScheme

  tIFScheme = (ifRSA1, ifRSA2,ifRW);

enumtSignEncoding

  tSignEncoding = (seEMSA2,      // As defined in P1363
                   seEMSA3,      // PKCS#1v1.5
                   seEMSA4,      // PKCS#1v2.1 (RSASSA-PSS)
                   seEMSA_TLS,   // TLS (PKCS#1v1.5 with no hash identifier and
                                 //      two digest values)
                   seNotSupported// Key used exclusively for encryption
                   );

enumtEncryptEncoding

  tEncryptEncoding = (eeEME1,           // PKCS#1v2.1 (RSAES-OAEP)
                      eeEME_PKCS1_v1_5, // PKCS#1v1.5
                      eeNotSupported);  // Key used exclusively for signing

enumtKeyDerivation

  tKeyDerivation = (kdKDF1,
                    kdKDF2,
                    kdX9_42ASN1BER,
                    kdX9_42Concatenation,
                    kdNone);

enumtDLSignatureScheme

  tDLSignatureScheme = (dlssaDSA,dlssaNR,dlSSADSA_P1363);

typetSsKeyExchangeClass

  tSsKeyExchangeClass = class of tSsKeyExchange;

typetExternalIFPrivateKeyClass

  tExternalIFPrivateKeyClass = class of tExternalIFPrivateKey;

enumtTrailerFieldEnum

  tTrailerFieldEnum = (tfBC,tfCC);

settTrailerFields

  tTrailerFields = set of tTrailerFieldEnum;

proctGetPKIFunc

  tGetPKIFunc = function(const aKey: IUnknown): OctetString;

Routines