|
@@ -76,6 +76,7 @@ resourcestring
|
|
|
SDeltaCertDescSerialNil = 'serialNumber';
|
|
SDeltaCertDescSerialNil = 'serialNumber';
|
|
|
SDeltaCertDescSpkiNil = 'subjectPublicKeyInfo';
|
|
SDeltaCertDescSpkiNil = 'subjectPublicKeyInfo';
|
|
|
SDeltaCertDescSigValNil = 'signatureValue';
|
|
SDeltaCertDescSigValNil = 'signatureValue';
|
|
|
|
|
+ SInvalidDsaParameter = 'Invalid DsaParameter: %s';
|
|
|
|
|
|
|
|
type
|
|
type
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1630,6 +1631,53 @@ type
|
|
|
|
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// The DsaParameter object.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ TDsaParameter = class(TAsn1Encodable, IDsaParameter)
|
|
|
|
|
+
|
|
|
|
|
+ strict private
|
|
|
|
|
+ var
|
|
|
|
|
+ FP, FQ, FG: IDerInteger;
|
|
|
|
|
+
|
|
|
|
|
+ function GetG: TBigInteger; inline;
|
|
|
|
|
+ function GetP: TBigInteger; inline;
|
|
|
|
|
+ function GetQ: TBigInteger; inline;
|
|
|
|
|
+
|
|
|
|
|
+ constructor Create(const ASeq: IAsn1Sequence); overload;
|
|
|
|
|
+
|
|
|
|
|
+ public
|
|
|
|
|
+ constructor Create(const AP, AQ, AG: TBigInteger); overload;
|
|
|
|
|
+
|
|
|
|
|
+ function ToAsn1Object(): IAsn1Object; override;
|
|
|
|
|
+
|
|
|
|
|
+ property P: TBigInteger read GetP;
|
|
|
|
|
+ property Q: TBigInteger read GetQ;
|
|
|
|
|
+ property G: TBigInteger read GetG;
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Parse a DsaParameter from an object.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ class function GetInstance(AObj: TObject): IDsaParameter; overload; static;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Get instance from ASN.1 convertible.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ class function GetInstance(const AObj: IAsn1Convertible): IDsaParameter; overload; static;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Parse a DsaParameter from DER-encoded bytes.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ class function GetInstance(const AEncoded: TCryptoLibByteArray): IDsaParameter; overload; static;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Parse a DsaParameter from a tagged object.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ class function GetInstance(const AObj: IAsn1TaggedObject; AExplicitly: Boolean): IDsaParameter; overload; static;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Get tagged DsaParameter.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ class function GetTagged(const ATaggedObject: IAsn1TaggedObject; ADeclaredExplicit: Boolean): IDsaParameter; static;
|
|
|
|
|
+
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// The AttCertIssuer object.
|
|
/// The AttCertIssuer object.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -7086,6 +7134,99 @@ begin
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+{ TDsaParameter }
|
|
|
|
|
+
|
|
|
|
|
+function TDsaParameter.GetP: TBigInteger;
|
|
|
|
|
+begin
|
|
|
|
|
+ result := FP.PositiveValue;
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+function TDsaParameter.GetQ: TBigInteger;
|
|
|
|
|
+begin
|
|
|
|
|
+ result := FQ.PositiveValue;
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+function TDsaParameter.GetG: TBigInteger;
|
|
|
|
|
+begin
|
|
|
|
|
+ result := FG.PositiveValue;
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+function TDsaParameter.ToAsn1Object: IAsn1Object;
|
|
|
|
|
+begin
|
|
|
|
|
+ result := TDerSequence.Create([FP, FQ, FG]);
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+constructor TDsaParameter.Create(const ASeq: IAsn1Sequence);
|
|
|
|
|
+begin
|
|
|
|
|
+ Inherited Create();
|
|
|
|
|
+ if (ASeq.Count <> 3) then
|
|
|
|
|
+ begin
|
|
|
|
|
+ raise EArgumentCryptoLibException.CreateResFmt(@SBadSequenceSize,
|
|
|
|
|
+ [ASeq.Count]);
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
|
|
+ FP := TDerInteger.GetInstance(ASeq[0]);
|
|
|
|
|
+ FQ := TDerInteger.GetInstance(ASeq[1]);
|
|
|
|
|
+ FG := TDerInteger.GetInstance(ASeq[2]);
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+constructor TDsaParameter.Create(const AP, AQ, AG: TBigInteger);
|
|
|
|
|
+begin
|
|
|
|
|
+ Inherited Create();
|
|
|
|
|
+ FP := TDerInteger.Create(AP);
|
|
|
|
|
+ FQ := TDerInteger.Create(AQ);
|
|
|
|
|
+ FG := TDerInteger.Create(AG);
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+class function TDsaParameter.GetInstance(AObj: TObject): IDsaParameter;
|
|
|
|
|
+begin
|
|
|
|
|
+ if AObj = nil then
|
|
|
|
|
+ begin
|
|
|
|
|
+ Result := nil;
|
|
|
|
|
+ Exit;
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
|
|
+ if Supports(AObj, IDsaParameter, Result) then
|
|
|
|
|
+ Exit;
|
|
|
|
|
+
|
|
|
|
|
+ Result := TDsaParameter.Create(TAsn1Sequence.GetInstance(AObj));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+class function TDsaParameter.GetInstance(const AObj: IAsn1Convertible): IDsaParameter;
|
|
|
|
|
+begin
|
|
|
|
|
+ if AObj = nil then
|
|
|
|
|
+ begin
|
|
|
|
|
+ Result := nil;
|
|
|
|
|
+ Exit;
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
|
|
+ if Supports(AObj, IDsaParameter, Result) then
|
|
|
|
|
+ Exit;
|
|
|
|
|
+
|
|
|
|
|
+ Result := TDsaParameter.Create(TAsn1Sequence.GetInstance(AObj));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+class function TDsaParameter.GetInstance(const AEncoded: TCryptoLibByteArray): IDsaParameter;
|
|
|
|
|
+begin
|
|
|
|
|
+ if AEncoded = nil then
|
|
|
|
|
+ begin
|
|
|
|
|
+ Result := nil;
|
|
|
|
|
+ Exit;
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
|
|
+ Result := TDsaParameter.Create(TAsn1Sequence.GetInstance(AEncoded));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+class function TDsaParameter.GetInstance(const AObj: IAsn1TaggedObject; AExplicitly: Boolean): IDsaParameter;
|
|
|
|
|
+begin
|
|
|
|
|
+ Result := TDsaParameter.Create(TAsn1Sequence.GetInstance(AObj, AExplicitly));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
|
|
+class function TDsaParameter.GetTagged(const ATaggedObject: IAsn1TaggedObject; ADeclaredExplicit: Boolean): IDsaParameter;
|
|
|
|
|
+begin
|
|
|
|
|
+ Result := TDsaParameter.Create(TAsn1Sequence.GetTagged(ATaggedObject, ADeclaredExplicit));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
{ TDistributionPointName }
|
|
{ TDistributionPointName }
|
|
|
|
|
|
|
|
class function TDistributionPointName.GetInstance(AObj: TObject): IDistributionPointName;
|
|
class function TDistributionPointName.GetInstance(AObj: TObject): IDistributionPointName;
|