Browse Source

add DhKeyAgreement in PkcsObjectIdentifiers

Ugochukwu Mmaduekwe 6 years ago
parent
commit
496835338a
1 changed files with 16 additions and 2 deletions
  1. 16 2
      CryptoLib/src/Asn1/Pkcs/ClpPkcsObjectIdentifiers.pas

+ 16 - 2
CryptoLib/src/Asn1/Pkcs/ClpPkcsObjectIdentifiers.pas

@@ -35,13 +35,20 @@ type
     // object identifiers for digests
     //
     DigestAlgorithm: String = '1.2.840.113549.2';
+    //
+    // pkcs-3 OBJECT IDENTIFIER ::= {
+    // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 3 }
+    //
+    Pkcs3: String = '1.2.840.113549.1.3';
 
   class var
 
     FIsBooted: Boolean;
-    FMD2, FMD4, FMD5, FIdHmacWithSha1, FIdHmacWithSha224, FIdHmacWithSha256,
-      FIdHmacWithSha384, FIdHmacWithSha512: IDerObjectIdentifier;
+    FDhKeyAgreement, FMD2, FMD4, FMD5, FIdHmacWithSha1, FIdHmacWithSha224,
+      FIdHmacWithSha256, FIdHmacWithSha384, FIdHmacWithSha512
+      : IDerObjectIdentifier;
 
+    class function GetDhKeyAgreement: IDerObjectIdentifier; static; inline;
     class function GetMD2: IDerObjectIdentifier; static; inline;
     class function GetMD4: IDerObjectIdentifier; static; inline;
     class function GetMD5: IDerObjectIdentifier; static; inline;
@@ -56,6 +63,7 @@ type
 
   public
 
+    class property DhKeyAgreement: IDerObjectIdentifier read GetDhKeyAgreement;
     //
     // md2 OBJECT IDENTIFIER ::=
     // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 2}
@@ -94,6 +102,7 @@ class procedure TPkcsObjectIdentifiers.Boot;
 begin
   if not FIsBooted then
   begin
+    FDhKeyAgreement := TDerObjectIdentifier.Create(Pkcs3 + '.1');
     FMD2 := TDerObjectIdentifier.Create(DigestAlgorithm + '.2');
     FMD4 := TDerObjectIdentifier.Create(DigestAlgorithm + '.4');
     FMD5 := TDerObjectIdentifier.Create(DigestAlgorithm + '.5');
@@ -107,6 +116,11 @@ begin
   end;
 end;
 
+class function TPkcsObjectIdentifiers.GetDhKeyAgreement: IDerObjectIdentifier;
+begin
+  result := FDhKeyAgreement;
+end;
+
 class function TPkcsObjectIdentifiers.GetIdHmacWithSha1: IDerObjectIdentifier;
 begin
   result := FIdHmacWithSha1;