Feature notes: PKIX / CMS implementation notes
inherits from Exception
(no public members)
inherits from eASN1Error
(no public members)
inherits from eASN1Error
(no public members)
inherits from eASN1DataError
(no public members)
(no public members)
(no public members)
fCls: Byte;
fConstructed: Boolean;
fTag: Cardinal;
fTagKind: tASN1TagKind;
fVarName: string;
fRangeLow: Int64;
fRangeHigh: Int64;
fKind: tASN1RangeKind;
fTagDef: tASN1TagDefinition;
fOptSpec: tASN1OptSpec;
fDefaultValue: string;
fInformationObject: tASN1InformationObjectClass;
fInformationObjectField: string;
fRange: tASN1RangeDefinition;
fClass: tASN1StructClass;
fMetaTypeName: string;
fRange: tASN1RangeDefinition;
fEnumTypeInfo: PTypeInfo;
fTagCount: Integer;
fTags: pASN1TagDefinition;
fFieldCount: Integer;
fFields: pASN1FieldDefinition;
(no public members)
Minimal, type-agnostic view of an ASN.1 node. Application code obtains this interface when it does not know (or care about) the concrete node class and only needs to measure, edit or copy raw content -- for example when walking a decoded certificate/PKCS structure generically.
procedure TypeIdentify;
function CalculateLength(aCoder : iASN1DataCoder = nil; aWithTag: Boolean = False) : Integer;
procedure EditContent(const aBuffer: tBytes); overload;
function ContentAsOctetString: OctetString;
procedure CopyContents(const aBuffer: IInterface);
inherits from iASN1Compat
Adds the ASN.1 identifier fields (class/tag/constructed) plus type name and range metadata on top of iASN1Compat. Application code uses this when it needs to inspect or override the wire identity of a node -- e.g. reading the tag of an unknown field, or forcing a context-specific tag when hand- building a structure.
function GetCls: Byte;
function GetConstructed: Boolean;
function GetTag: Cardinal;
function GetTypeName: string;
function GetRange: tASN1RangeDefinition;
procedure SetCls(const Value: Byte);
procedure SetConstructed(const Value: Boolean);
procedure SetTag(const Value: Cardinal);
procedure SetTypeName(const Value: string);
property Cls: Byte read GetCls write SetCls;
property Constructed: Boolean read GetConstructed write SetConstructed;
property Tag: Cardinal read GetTag write SetTag;
property TypeName: string read GetTypeName write SetTypeName;
inherits from iASN1CustomBase
The primary reference-counted handle for any ASN.1 node. This is the interface an application holds onto when it decodes, inspects or builds a node -- most high-level APIs in the library hand back or accept an iASN1Base. It carries all of the identifier, range and content operations inherited above.
function GetStruct: tASN1Base;
inherits from iGCWeakField
function GetStruct: tASN1Base;
inherits from iGCField
function GetStruct: tASN1Base;
(no public members)
(no public members)
(no public members)
inherits from iASN1CustomBase
Handle for an ASN.1 CHOICE node -- a node that holds exactly one of several alternative types. Application code uses this when working with schema fields defined as a CHOICE (e.g. a GeneralName or an AlgorithmIdentifier parameter) to select or read the currently active alternative.
function GetStruct: tASN1CustomChoice;
(no public members)
inherits from iGCField
function GetStruct: tASN1CustomInstance;
inherits from iASN1CustomBase
An "instance-of-a-type" ASN.1 node: an information-object-driven field whose concrete type is chosen at decode time from a type identifier (e.g. the AlgorithmIdentifier/parameters or ANY-DEFINED-BY constructs used throughout PKIX and CMS). This is the common base that the strongly typed parameter/content interfaces extend -- e.g. iContent, iPKAlgorithmID and iCEParams (in stCMS/stPkixCert/stCMSAlgorithms) all descend from it.
function GetStruct: tASN1CustomInstance;
inherits from iGCField
function GetObject: tASN1InformationObject;
inherits from tGCAbstractObject
implements iASN1InformationObject
class function Name: string; virtual;
procedure SetField(const aName: string; aField: iASN1Base); virtual; abstract;
function GetField(const aName: string): iASN1Base; virtual; abstract;
function GetFieldClass(const aField: iASN1Base): tASN1StructClass; virtual; abstract;
procedure Update(const aField: iASN1Base); virtual; abstract;
procedure Resolve(const aField, aData: iASN1Base); virtual;
inherits from tASN1InformationObject
procedure SetField(const aName: string; aField: iASN1Base); override;
function GetField(const aName: string): iASN1Base; override;
function GetFieldClass(const aField: iASN1Base): tASN1StructClass; override;
procedure Update(const aField: iASN1Base); override;
inherits from tASN1InformationObject
procedure SetField(const aName: string; aField: iASN1Base); override;
function GetField(const aName: string): iASN1Base; override;
function GetFieldClass(const aField: iASN1Base): tASN1StructClass; override;
procedure Update(const aField: iASN1Base); override;
(no public members)
inherits from iGCField
function GetContext: tASN1InformationObjectContext;
inherits from tGCAbstractObject
implements iASN1InformationObjectContext
procedure Add(aObject: tASN1InformationObject);
function GetFieldClass(const aField: iASN1Base): tASN1StructClass;
procedure Update(const aField: iASN1Base);
procedure Resolve(const aField, aData: iASN1Base);
property Objects[const aClass: tASN1InformationObjectClass]: tASN1InformationObject read GetObjects;
(no public members)
function GetCoder: tASN1DataCoder;
inherits from iGCField
function GetCoder: tASN1DataCoder;
inherits from iASN1DataCoder
function GetDelimiter: string;
function GetHeaderData: TStrings;
function GetKey: iSecretKey;
procedure SetDelimiter(const aValue: string);
procedure SetHeaderData(const Value: TStrings);
procedure SetKey(const Value: iSecretKey);
property Delimiter: string read GetDelimiter write SetDelimiter;
property HeaderData: TStrings read GetHeaderData write SetHeaderData;
property Key: iSecretKey read GetKey write SetKey;
fOffset: Integer;
fLength: Integer;
fState: tASN1ReadTagState;
fCls: Byte;
fConstructed: Boolean;
fTag: Cardinal;
fLength: Integer;
inherits from tGCAbstractObject
implements iASN1DataCoder, iASN1DataCoderField
class function DefaultCoder: iASN1DataCoder;
class procedure CopyStreamedContents(aSource, aDest: iASN1Base);
function ReadRootTag(aData: tASN1Base): Boolean; virtual; abstract;
function ReadHeader(aParent : tASN1Base; aIndex : Integer; const aHdr : tASN1FieldDefinition; var aOffset : Integer; var aLength : Integer; var aFieldOffset: tASN1FieldOffset; var aExtStatus : tExtensionVersionStatus; var aExtVersion : Cardinal) : Boolean; virtual; abstract;
function ReadGenericItem(aParent: tASN1GenericStruct; var aOffset: Integer; var aLength: Integer) : iASN1Base; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; out aResult: Boolean); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; out aResult: Integer); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; out aResult: Int64); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: iMPInteger); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: iDSInteger); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: tBytes); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: ObjectIdentifier); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: AnsiString); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: UnicodeString); overload; virtual; abstract;
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; out aResult: TSystemTime); overload; virtual; abstract;
function WriteBoolean(aValue : Boolean; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteBoolean(aValue : Boolean): tBytes; overload;
function WriteSmallInteger(aValue : Int64; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteSmallInteger(aValue : Int64): tBytes; overload;
function WriteLargeInteger(aValue : iMPInteger; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteLargeInteger(aValue : iMPInteger): tBytes; overload;
function WriteLargeInteger(aValue : iDSInteger; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteLargeInteger(aValue : iDSInteger): tBytes; overload;
function WriteNamedInteger(aData : tASN1Base; aValue : Integer; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteNamedInteger(aData : tASN1Base; aValue : Integer) : tBytes; overload;
function WriteBitString(aData : tASN1Base; aValue : tBytes; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteBitString(aData : tASN1Base; aValue : tBytes) : tBytes; overload;
function WriteOctetString(aValue : tBytes; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteOctetString(aValue : tBytes): tBytes; overload;
function WriteNull(aPresent: Boolean; aBuffer : tBytes; aOffset : Integer = 0) : tBytes; overload; virtual; abstract;
function WriteNull(aPresent: Boolean): tBytes; overload;
function WriteObjectIdentifier(aValue : ObjectIdentifier; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteObjectIdentifier(aValue : ObjectIdentifier): tBytes; overload;
function WriteString(aValue : string; aTag : Byte; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteString(aValue : string; aTag : Byte) : tBytes; overload;
function WriteUtcTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteUtcTime(const aValue : TSystemTime): tBytes; overload;
function WriteGeneralizedTimeTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteGeneralizedTimeTime(const aValue : TSystemTime): tBytes; overload;
function WriteX509GeneralizedTimeTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
function WriteX509GeneralizedTimeTime(const aValue : TSystemTime): tBytes; overload;
function EncodeContents(aItem : tASN1Base; aIncludeTag: Boolean) : tBytes; virtual; abstract;
function EncodeContentsOS(aItem : tASN1Base; aIncludeTag: Boolean) : OctetString; virtual; abstract;
function CalculateLength(aData: tASN1Base; aWithTag: Boolean = False): Integer; virtual; abstract;
function LoadFromStream(aStream: TStream; aItem : tASN1Base) : Int64; virtual; abstract;
function SaveToStream(aStream: TStream; aItem : tASN1Base) : Int64; virtual;
fCoder: iASN1DataCoderField;
fReadTagState: tASN1ReadTagState;
fOffset: Integer;
fLength: Integer;
fClosingTagCount: Integer;
(no public members)
inherits from iASN1CustomBase
The interface of any constructed ASN.1 node (SEQUENCE, SET, SEQUENCE OF, etc.). An application uses this to walk the children of a parsed structure - for example iterating the entries of a SEQUENCE OF while reading a certificate chain, a CMS SignedData, or a distinguished name.
function GetStruct: tASN1AbstractStruct;
function GetItemCount: Integer;
function GetItems(aIndex: Integer): iASN1Base;
property ItemCount: Integer read GetItemCount;
property Items[aIndex: Integer]: iASN1Base read GetItems;
inherits from iGCField
function GetStruct: tASN1AbstractStruct;
inherits from iASN1Base
The interface of an ASN.1 OCTET STRING (or any node whose content is a raw byte payload). Applications use it to read or set the bytes of a decoded field - e.g. a certificate's SubjectPublicKey/serial-as-bytes, a CMS encrypted content, a key blob, or an extension's DER-encoded value.
function GetLength: Int64;
function ContentAsOctetString: OctetString; overload;
procedure ContentAsOctetString(var aOS: iSecretKey); overload;
function ContentAsBytes: TBytes;
procedure EditContent(const aValue: tBytes);
property Length: Int64 read GetLength;
inherits from iASN1Base
The interface of an ASN.1 INTEGER node. Applications use it to read or set integer-valued fields of a decoded structure - version numbers, tags, small counters via the fixed-size accessors, or arbitrary-precision values (RSA modulus/exponent, certificate serial number, DSA/ECDSA parameters and signature components) via the multi-precision accessors below.
function ContentAsInt64: Int64;
function ContentAsInteger: Integer;
procedure ContentAsMPInt(X: IMPInteger); overload;
function ContentAsMPInt(aPool: iBasicMPArith): iMPInteger; overload;
function ContentAsDSInt(aLocal: Boolean = False): iDSInteger;
procedure EditContent(const aValue: Int64); overload;
procedure EditContent(const aValue: iMPInteger); overload;
procedure EditContent(const aValue: iDSInteger); overload;
inherits from tGCAbstractObject
implements iASN1Base, iASN1BaseField
class function GetActualClass: tASN1StructClass;
class function MetaSupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; virtual;
function SupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; virtual;
class function MetaCreateIfMatch(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : iASN1Base; virtual;
function CalculateLength(aCoder : iASN1DataCoder = nil; aWithTag: Boolean = False) : Integer;
procedure LoadFromCoder(aCoder: iASN1DataCoder);
procedure LoadFromFile(const aFileName: string; aFormat : tASN1DataCoderClass);
function LoadFromStream(const aStream: tStream; aFormat: tASN1DataCoderClass) : Int64; virtual;
procedure SaveToFile(const aFileName: string; aFormat : tASN1DataCoderClass);
function SaveToStream(const aStream: tStream; aFormat: tASN1DataCoderClass) : Int64;
procedure CopyStreamedContents(const aSource: iASN1Base); overload; virtual;
procedure CopyStreamedContents(const aSource: iASN1CustomStruct); overload; virtual;
procedure CopyStreamedContents(const aSource: iASN1CustomChoice); overload; virtual;
procedure CopyStreamedContents(const aSource: iASN1CustomInstance); overload; virtual;
procedure EditContent(const aValue: string); overload; virtual;
procedure EditContent(const aValue: ObjectIdentifier); overload; virtual;
procedure EditContent(const aValue: OctetString); overload; virtual;
procedure EditContent(const aValue: tBytes); overload; virtual;
procedure EditContent(const aValue: Boolean); overload; virtual;
procedure EditContent(const aValue: tDateTime); overload; virtual;
procedure EditContent(const aValue: Int64); overload; virtual;
procedure EditContent(const aValue: Extended); overload; virtual;
procedure EditContent(const aValue: tSystemTime); overload; virtual;
procedure EditContent(const aValue : stMPArithTypes.iECPoint); overload; virtual;
procedure EditContent(const aValue : StreamSec.DSI.PKTypes.iECPoint); overload; virtual;
procedure EditContent(const aValue: iMPInteger); overload; virtual;
procedure EditContent(const aValue: iDSInteger); overload; virtual;
function EncodedContents(aCoder : iASN1DataCoder; aIncludeTag: Boolean) : tBytes;
function EncodedContentsOS(aCoder : iASN1DataCoder; aIncludeTag: Boolean) : OctetString;
function ContentAsBoolean: Boolean; virtual;
function ContentAsCardinal: Cardinal; virtual;
function ContentAsDateTime: tDateTime; virtual;
function ContentAsECPoint(var aP: stMPArithTypes.iECPoint; const aC: stMPArithTypes.iECurve) : Boolean; overload; virtual;
function ContentAsECPoint(var aP: StreamSec.DSI.PKTypes.iECPoint; const aC: StreamSec.DSI.PKTypes.iECurve) : Boolean; overload; virtual;
function ContentAsInt64: Int64; virtual;
function ContentAsInteger: Integer; virtual;
procedure ContentAsMPInt(X: IMPInteger); overload; virtual;
function ContentAsMPInt(aPool: iBasicMPArith): iMPInteger; overload; virtual;
function ContentAsDSInt(aLocal: Boolean = False): iDSInteger; virtual;
function ContentAsOctetString: OctetString; overload; virtual;
procedure ContentAsOctetString(var aOS: iSecretKey); overload; virtual;
function ContentAsOctetStringBytes: tBytes; virtual;
function ContentAsBytes: tBytes; overload; virtual;
function ContentAsOID: ObjectIdentifier; virtual;
function ContentAsReal: Extended; virtual;
function ContentAsSet(var aSet; aSize: Integer): Boolean; virtual;
function ContentAsString: string; virtual;
function ContentAsASN1Value: string; overload; virtual;
function ContentAsASN1Value(aIndent: Integer): string; overload; virtual;
function ContentAsSystemTime(var aTime: tSystemTime): Boolean; virtual;
function ContentAsUInt64: Int64; virtual;
procedure ContentAsUMPInt(X: IMPInteger); virtual;
function ContentAsUDSInt(aLocal: Boolean = False): iDSInteger; virtual;
function ContentAsVariant: Variant; virtual;
function Compare(aValue: iASN1Base): Boolean; virtual;
function CompareOS(aValue: iASN1Base): Integer; virtual;
function CompareASN1Value(const aValue: string): Boolean; virtual;
function UpdatePresent: Boolean; virtual;
procedure ExpandFull; virtual;
procedure SortSET(aRecurse: Boolean = True); virtual;
property Cls: Byte read GetCls write SetCls;
property Constructed: Boolean read GetConstructed write SetConstructed;
property Tag: Cardinal read GetTag write SetTag;
property VarName: string read GetVarName write SetVarName;
property TypeName: string read GetTypeName write SetTypeName;
property Present: Boolean read GetPresent write SetPresent;
property Optional: Boolean read GetOptional write SetOptional;
property Parent: iASN1CustomStruct read GetParent;
property Modified: Boolean read GetModified write SetModified;
property ReadOnly: Boolean read GetReadOnly write SetReadOnly;
function FindSelectedItem(aChoiceIndex: Integer): iASN1Base; override;
procedure Delete(aIndex: Integer); virtual; abstract;
procedure ContentAsStrings(aStrings: TStrings; aIndent: Integer); virtual;
function ContentAsASN1Value(aIndent: Integer): string; override;
function ContentAsString: string; override;
procedure EditContent(const aValue: tBytes); override;
function Compare(aValue: iASN1Base): Boolean; override;
procedure UpdatePresentItems; virtual;
function UpdatePresent: Boolean; override;
procedure ExpandFull; override;
property Items[aIndex: Integer]: iASN1Base read GetItems;
property ItemCount: Integer read GetItemCount;
inherits from tASN1AbstractStruct
class function MetaCreatePrimitive(aCls : Byte; aTag : Cardinal; aLength: Integer) : iASN1Base; virtual;
class function MetaSupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override;
function SupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override;
procedure Delete(aIndex: Integer); override;
procedure ContentAsStrings(aStrings: TStrings; aIndent: Integer); override;
inherits from tASN1AbstractStruct
destructor Destroy; override;
procedure Delete(aIndex: Integer); override;
procedure UpdatePresentItems; override;
function UpdatePresent: Boolean; override;
procedure SortSET(aRecurse: Boolean = True); override;
inherits from tASN1CustomStruct
function FindSelectedItem(aChoiceIndex: Integer): iASN1Base; override;
function AddField(aChoiceIndex: Integer = -1): iASN1Base; virtuaL;
function FindAddSelectedItem(aChoiceIndex: Integer): iASN1Base; virtual;
procedure Delete(aIndex: Integer); override;
procedure UpdatePresentItems; override;
inherits from tASN1Base
class function MetaSupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override;
function SupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override;
function Compare(aValue: iASN1Base): Boolean; override;
function FindSelectedItem(aChoiceIndex: Integer): iASN1Base; override;
function ContentAsASN1Value: string; override;
function ContentAsASN1Value(aIndent: Integer): string; override;
function ContentAsInteger: Integer; override;
function ContentAsString: string; override;
function ContentAsOID: ObjectIdentifier; override;
function ContentAsSet(var aSet; aSize: Integer): Boolean; override;
function ContentAsDateTime: TDateTime; override;
procedure EditContent(const aValue: string); override;
procedure EditContent(const aValue: Int64); override;
procedure EditContent(const aValue: tDateTime); override;
function UpdatePresent: Boolean; override;
procedure ExpandFull; override;
function IsOptionalWrite: Boolean;
property Data: iASN1Base read GetData;
property ChoiceTypeName: string read GetChoiceTypeName;
procedure SelectChoice(aIndex: Integer); virtual;
function TrySelectChoice(aCls : Byte; aConstructed: Boolean; aTag : Cardinal) : Boolean; virtual;
procedure SortSET(aRecurse: Boolean = True); override;
property ChoiceIndex: Integer read GetChoiceIndex;
property Selected: Boolean read fSelected;
inherits from tASN1CustomChoice
implements iASN1CustomInstanceField, iASN1CustomInstance
procedure SelectChoice(aIndex: Integer); override;
inherits from tASN1CustomChoice
(no public members)
inherits from tASN1Base
(no public members)
and AUTOMATIC TAGS are in effect, otherwise atkUndef must be used. If atkAutomatic is used, fTagDef.fTag equals the next automatic tag in the sequence.
fTagDef.fTagKind = atkAutomatic, this can only occur as the last field