Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stASN1Base

Feature notes: PKIX / CMS implementation notes

Classes, interfaces and records

classeASN1Error

inherits from Exception

(no public members)

classeASN1NotSupported

inherits from eASN1Error

(no public members)

classeASN1DataError

inherits from eASN1Error

(no public members)

classeASN1EncodingError

inherits from eASN1DataError

(no public members)

classtASN1Base

(no public members)

classtASN1InformationObject

(no public members)

recordtASN1TagDefinition

fCls: Byte; fConstructed: Boolean; fTag: Cardinal; fTagKind: tASN1TagKind; fVarName: string;

recordtASN1RangeDefinition

fRangeLow: Int64; fRangeHigh: Int64; fKind: tASN1RangeKind;

recordtASN1FieldDefinition

fTagDef: tASN1TagDefinition; fOptSpec: tASN1OptSpec; fDefaultValue: string; fInformationObject: tASN1InformationObjectClass; fInformationObjectField: string; fRange: tASN1RangeDefinition; fClass: tASN1StructClass;

recordtASN1ClassDefinition

fMetaTypeName: string; fRange: tASN1RangeDefinition; fEnumTypeInfo: PTypeInfo; fTagCount: Integer; fTags: pASN1TagDefinition; fFieldCount: Integer; fFields: pASN1FieldDefinition;

interfaceiASN1DataCoder

(no public members)

interfaceiASN1Compat

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;
Resolves the concrete node class from the parent structure's template so that a placeholder node built during decoding takes on its real (mapped) type. Full description »
function CalculateLength(aCoder : iASN1DataCoder = nil; aWithTag: Boolean = False) : Integer;
Returns the number of DER-encoded octets this node would occupy, without actually producing the buffer. Use it to size an output buffer or to pre-compute a length before serialising. Pass aCoder to encode with a specific coder (defaults to the node's read-only coder); set aWithTag True to include the identifier+length header, not just the content.
procedure EditContent(const aBuffer: tBytes); overload;
Replaces this node's content from a raw byte buffer, letting the concrete node re-interpret the bytes as its own type. Use when populating a node from externally supplied raw octets. The base class rejects it; only nodes that can interpret raw bytes (e.g. octet/bit strings) accept it.
function ContentAsOctetString: OctetString;
Returns this node's content as an OctetString. Use to pull the raw value out of a leaf node. Nodes that have no octet representation raise eASN1NotSupported.
procedure CopyContents(const aBuffer: IInterface);
Deep-copies the streamed content of another node (passed as its iASN1Base interface) into this one. Use to clone a decoded field into a node you are building.

interfaceiASN1CustomBase

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;
Getter for Cls; see the Cls property. Internal accessor.
function GetConstructed: Boolean;
Getter for Constructed; see the Constructed property. Internal accessor.
function GetTag: Cardinal;
Getter for Tag; see the Tag property. Internal accessor.
function GetTypeName: string;
Getter for TypeName; see the TypeName property. Internal accessor.
function GetRange: tASN1RangeDefinition;
Returns the value range constraint (low/high bound and kind) declared for this node in its ASN.1 template. Use when validating that a decoded INTEGER/ENUMERATED lies within the schema's permitted range.
procedure SetCls(const Value: Byte);
Setter for Cls; see the Cls property. Internal accessor.
procedure SetConstructed(const Value: Boolean);
Setter for Constructed; see the Constructed property. Internal accessor.
procedure SetTag(const Value: Cardinal);
Setter for Tag; see the Tag property. Internal accessor.
procedure SetTypeName(const Value: string);
Setter for TypeName; see the TypeName property. Internal accessor.
property Cls: Byte read GetCls write SetCls;
The ASN.1 tag class of this node (universal, application, context-specific or private). Read it to discover how an unknown field is tagged; assign it only when hand-constructing a node with explicit/implicit tagging. Concrete leaf nodes must implement the setter; the base class raises.
property Constructed: Boolean read GetConstructed write SetConstructed;
True if this node is a constructed (nested) encoding, False if primitive. Use to tell a wrapping SEQUENCE/SET from a leaf value; assignable only on nodes that support switching their P/C bit.
property Tag: Cardinal read GetTag write SetTag;
The ASN.1 tag number of this node. Read it to identify a field by its tag; assign it to re-tag a node when emitting implicitly/explicitly tagged content. Base nodes report V_ASN1_UNDEF and reject writes.
property TypeName: string read GetTypeName write SetTypeName;
The schema type name assigned to this node (from the compiled template). Useful for diagnostics or reflection over a decoded structure; only nodes whose type is not fixed by their class accept a new name.

interfaceiASN1Base

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;
Unwraps the interface to the concrete tASN1Base implementation object. Internal wiring used to reach class-level methods across a reference; application code stays at the interface level and rarely calls this.

interfaceiASN1BaseWeakField

inherits from iGCWeakField

function GetStruct: tASN1Base;

interfaceiASN1BaseField

inherits from iGCField

function GetStruct: tASN1Base;

classtASN1CustomStruct

(no public members)

classtASN1GenericStruct

(no public members)

classtASN1CustomChoice

(no public members)

interfaceiASN1CustomChoice

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;
Unwraps the interface to the concrete tASN1CustomChoice object. Internal wiring for class-level access; application code stays at the interface level and rarely calls this directly.

classtASN1CustomInstance

(no public members)

interfaceiASN1CustomInstanceField

inherits from iGCField

function GetStruct: tASN1CustomInstance;

interfaceiASN1CustomInstance

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;
Returns the underlying tASN1CustomInstance object backing this interface. Rarely called by applications directly; it is the bridge the framework uses to reach the concrete class (implementation returns Self).

interfaceiASN1InformationObject

inherits from iGCField

function GetObject: tASN1InformationObject;

classtASN1InformationObject

inherits from tGCAbstractObject

implements iASN1InformationObject

class function Name: string; virtual;
Returns the value of ClassName.
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;

classtASN1TypeIdentifier

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;

classtASN1SetOfTypeIdentifier

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;

classtASN1InformationObjectContext

(no public members)

interfaceiASN1InformationObjectContext

inherits from iGCField

function GetContext: tASN1InformationObjectContext;

classtASN1InformationObjectContext

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;

classtASN1DataCoder

(no public members)

interfaceiASN1DataCoder

function GetCoder: tASN1DataCoder;

interfaceiASN1DataCoderField

inherits from iGCField

function GetCoder: tASN1DataCoder;

interfaceiPEMCoder

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;

recordtASN1FieldOffset

fOffset: Integer; fLength: Integer; fState: tASN1ReadTagState;

recordtDERHeader

fCls: Byte; fConstructed: Boolean; fTag: Cardinal; fLength: Integer;

classtASN1DataCoder

inherits from tGCAbstractObject

implements iASN1DataCoder, iASN1DataCoderField

class function DefaultCoder: iASN1DataCoder;
Delegates to gDefaultCoder.Create, forwarding gcamFirstAssignment, and returns its result.
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;
Integer (named, enumerated)
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; out aResult: Int64); overload; virtual; abstract;
Integer (small)
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;
Integer (large)
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: tBytes); overload; virtual; abstract;
Bit string, octet string
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: ObjectIdentifier); overload; virtual; abstract;
Object identifier
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: AnsiString); overload; virtual; abstract;
AnsiString (PrintableString etc)
procedure ReadContent(aItem : tASN1Base; var aOffset: Integer; var aLength: Integer; var aResult: UnicodeString); overload; virtual; abstract;
UnicodeString (BMPString etc)
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;
Delegates to WriteBoolean, forwarding aValue and nil, and returns its result.
function WriteBoolean(aValue : Boolean): tBytes; overload;
Delegates to WriteBoolean, forwarding aValue and nil, and returns its result.
function WriteSmallInteger(aValue : Int64; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteSmallInteger, forwarding aValue and nil, and returns its result.
function WriteSmallInteger(aValue : Int64): tBytes; overload;
Delegates to WriteSmallInteger, forwarding aValue and nil, and returns its result.
function WriteLargeInteger(aValue : iMPInteger; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteLargeInteger, forwarding aValue and nil, and returns its result.
function WriteLargeInteger(aValue : iMPInteger): tBytes; overload;
Delegates to WriteLargeInteger, forwarding aValue and nil, and returns its result.
function WriteLargeInteger(aValue : iDSInteger; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteLargeInteger, forwarding aValue and nil, and returns its result.
function WriteLargeInteger(aValue : iDSInteger): tBytes; overload;
Delegates to WriteLargeInteger, forwarding aValue and nil, and returns its result.
function WriteNamedInteger(aData : tASN1Base; aValue : Integer; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteNamedInteger, forwarding aData, aValue and nil, and returns its result.
function WriteNamedInteger(aData : tASN1Base; aValue : Integer) : tBytes; overload;
Delegates to WriteNamedInteger, forwarding aData, aValue and nil, and returns its result.
function WriteBitString(aData : tASN1Base; aValue : tBytes; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteBitString, forwarding aData, aValue and nil, and returns its result.
function WriteBitString(aData : tASN1Base; aValue : tBytes) : tBytes; overload;
Delegates to WriteBitString, forwarding aData, aValue and nil, and returns its result.
function WriteOctetString(aValue : tBytes; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteOctetString, forwarding aValue and nil, and returns its result.
function WriteOctetString(aValue : tBytes): tBytes; overload;
Delegates to WriteOctetString, forwarding aValue and nil, and returns its result.
function WriteNull(aPresent: Boolean; aBuffer : tBytes; aOffset : Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteNull, forwarding aPresent and nil, and returns its result.
function WriteNull(aPresent: Boolean): tBytes; overload;
Delegates to WriteNull, forwarding aPresent and nil, and returns its result.
function WriteObjectIdentifier(aValue : ObjectIdentifier; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteObjectIdentifier, forwarding aValue and nil, and returns its result.
function WriteObjectIdentifier(aValue : ObjectIdentifier): tBytes; overload;
Delegates to WriteObjectIdentifier, forwarding aValue and nil, and returns its result.
function WriteString(aValue : string; aTag : Byte; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteString, forwarding aValue, aTag and nil, and returns its result.
function WriteString(aValue : string; aTag : Byte) : tBytes; overload;
Delegates to WriteString, forwarding aValue, aTag and nil, and returns its result.
function WriteUtcTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteUtcTime, forwarding aValue and nil, and returns its result.
function WriteUtcTime(const aValue : TSystemTime): tBytes; overload;
Delegates to WriteUtcTime, forwarding aValue and nil, and returns its result.
function WriteGeneralizedTimeTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteGeneralizedTimeTime, forwarding aValue and nil, and returns its result.
function WriteGeneralizedTimeTime(const aValue : TSystemTime): tBytes; overload;
Delegates to WriteGeneralizedTimeTime, forwarding aValue and nil, and returns its result.
function WriteX509GeneralizedTimeTime(const aValue : TSystemTime; aBuffer: tBytes; aOffset: Integer = 0) : tBytes; overload; virtual; abstract;
Delegates to WriteX509GeneralizedTimeTime, forwarding aValue and nil, and returns its result.
function WriteX509GeneralizedTimeTime(const aValue : TSystemTime): tBytes; overload;
Delegates to WriteX509GeneralizedTimeTime, forwarding aValue and nil, and returns its result.
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;

recordtReadOnlyState

fCoder: iASN1DataCoderField; fReadTagState: tASN1ReadTagState; fOffset: Integer; fLength: Integer; fClosingTagCount: Integer;

classtASN1AbstractStruct

(no public members)

interfaceiASN1CustomStruct

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;
Returns the underlying tASN1AbstractStruct object. Internal wiring the framework uses to reach the concrete class (returns Self); applications normally stay at the interface level.
function GetItemCount: Integer;
Backing getter for the ItemCount property (see below).
function GetItems(aIndex: Integer): iASN1Base;
Backing getter for the Items property (see below).
property ItemCount: Integer read GetItemCount;
Number of child nodes in this constructed value. Use it as the loop bound when enumerating the members of a SEQUENCE/SET or the elements of a SEQUENCE OF / SET OF while decoding a parsed structure.
property Items[aIndex: Integer]: iASN1Base read GetItems;
Zero-based indexed access to the child nodes of this constructed value. This is the primary way an application reads sub-fields out of a decoded SEQUENCE/SET, then narrows each to the specific leaf interface (e.g. iASN1Integer or iASN1OctetString) it expects.

interfaceiASN1CustomStructField

inherits from iGCField

function GetStruct: tASN1AbstractStruct;

interfaceiASN1OctetString

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;
Backing getter for the Length property (see below).
function ContentAsOctetString: OctetString; overload;
Returns the content as an OctetString (Delphi AnsiString of bytes). Use this convenience form when reading a small byte field out of a parsed structure and OctetString is the type you want to work with.
procedure ContentAsOctetString(var aOS: iSecretKey); overload;
Returns the content into a protected iSecretKey buffer instead of a plain string. Use this overload for sensitive payloads (private-key octets, symmetric keys, seeds) so the bytes live in memory that is zeroized on release rather than in an ordinary string.
function ContentAsBytes: TBytes;
Returns the content as a TBytes array. This is the usual accessor when an application needs the raw bytes of a decoded OCTET STRING for further processing (hashing, feeding another decoder, comparing).
procedure EditContent(const aValue: tBytes);
Sets (writes) the byte content of this node when an application is building/encoding a structure rather than reading one - e.g. placing a computed signature, key blob, or nested DER value into an OCTET STRING field before it is serialized.
property Length: Int64 read GetLength;
Number of content bytes in this OCTET STRING. Read it to size a buffer or to validate a decoded field's length before consuming its bytes.

interfaceiASN1Integer

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;
Reads the value as a signed 64-bit integer. Use for INTEGER fields known to fit in 64 bits (versions, counters); raises/overflows for the large cryptographic integers - use the MPInt/DSInt accessors for those.
function ContentAsInteger: Integer;
Reads the value as a native signed Integer. Use for small bounded INTEGER fields (e.g. a certificate/CRL version) when parsing a structure.
procedure ContentAsMPInt(X: IMPInteger); overload;
Reads the value into a caller-supplied legacy IMPInteger (big-integer). Use when reading an arbitrary-precision INTEGER (RSA modulus, serial number) with the legacy multi-precision library. Compiled out in DSI_ONLY builds, which use the DSInt accessors instead.
function ContentAsMPInt(aPool: iBasicMPArith): iMPInteger; overload;
Reads the value as a new legacy iMPInteger allocated from the given pool. Same use as the procedure form but returns the big-integer as a result. Legacy-library path; absent in DSI_ONLY builds.
function ContentAsDSInt(aLocal: Boolean = False): iDSInteger;
Reads the value as a DSI-library iDSInteger (the current big-integer type). This is the preferred accessor for arbitrary-precision INTEGERs (RSA/DSA/EC parameters, serial numbers) in modern code. Pass aLocal=True to get a thread-local temporary not shared across threads.
procedure EditContent(const aValue: Int64); overload;
Sets the value from a 64-bit integer when building/encoding a structure (e.g. writing a version or a small INTEGER field before serialization).
procedure EditContent(const aValue: iMPInteger); overload;
Sets the value from a legacy iMPInteger big-integer when encoding a large INTEGER field. Legacy-library path; absent in DSI_ONLY builds.
procedure EditContent(const aValue: iDSInteger); overload;
Sets the value from a DSI iDSInteger big-integer when encoding a large INTEGER field (the preferred form for arbitrary-precision values in modern code).

classtASN1Base

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;
Delegates to MetaSupportsTag, forwarding aTag and aIdentifiers, and returns its result.
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;
CopyStreamedContents makes this instance a copy of aSource's encoding, decoded lazily. A copy is for reading and saving as it is: it is not meant to be modified. A value that has to differ from its source - a Name with another attribute, say - is built from scratch.
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;
Delegates to OSToBytes, forwarding ContentAsOctetString, and returns its result.
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;
Returns the value of ContentAsString.
function ContentAsASN1Value(aIndent: Integer): string; overload; virtual;
Returns the value of ContentAsString.
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;
Returns True if aValue equals ContentAsASN1Value; otherwise False.
function UpdatePresent: Boolean; virtual; procedure ExpandFull; virtual;
Use ExpandFull to "touch all" after load, to prevent lazy load issues
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;

classtASN1AbstractStruct

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;
Delegates to ContentAsASN1Value, forwarding 0, and returns its result.
procedure EditContent(const aValue: tBytes); override; function Compare(aValue: iASN1Base): Boolean; override; procedure UpdatePresentItems; virtual; function UpdatePresent: Boolean; override; procedure ExpandFull; override;
Use ExpandFull to "touch all" after load, to prevent lazy load issues
property Items[aIndex: Integer]: iASN1Base read GetItems; property ItemCount: Integer read GetItemCount;

classtASN1GenericStruct

inherits from tASN1AbstractStruct

class function MetaCreatePrimitive(aCls : Byte; aTag : Cardinal; aLength: Integer) : iASN1Base; virtual;
Delegates to DoCreatePrimitive, forwarding aCls, aTag and aLength, and returns its result.
class function MetaSupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override;
Returns the fConstructed value, obtained via aTag.
function SupportsTag(const aTag : tASN1TagDefinition; const aIdentifiers: array of tASN1Base) : Boolean; override; procedure Delete(aIndex: Integer); override; procedure ContentAsStrings(aStrings: TStrings; aIndent: Integer); override;

classtASN1CustomStruct

inherits from tASN1AbstractStruct

destructor Destroy; override; procedure Delete(aIndex: Integer); override; procedure UpdatePresentItems; override; function UpdatePresent: Boolean; override; procedure SortSET(aRecurse: Boolean = True); override;

classtASN1CustomOFStruct

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;

classtASN1CustomChoice

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;
Delegates to ContentAsASN1Value, forwarding 0, and returns its result.
function ContentAsASN1Value(aIndent: Integer): string; override;
Delegates to ContentAsASN1Value, forwarding 0, and returns its result.
function ContentAsInteger: Integer; override;
Returns the ContentAsInteger value, obtained via Data.GetStruct.
function ContentAsString: string; override;
Returns the ContentAsString value, obtained via Data.GetStruct.
function ContentAsOID: ObjectIdentifier; override;
Returns the ContentAsOID value, obtained via Data.GetStruct.
function ContentAsSet(var aSet; aSize: Integer): Boolean; override;
Delegates to Data.GetStruct.ContentAsSet, forwarding aSet and aSize, and returns its result.
function ContentAsDateTime: TDateTime; override;
Returns the ContentAsDateTime value, obtained via Data.GetStruct.
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;
Use ExpandFull to "touch all" after load, to prevent lazy load issues
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;

classtASN1CustomInstance

inherits from tASN1CustomChoice

implements iASN1CustomInstanceField, iASN1CustomInstance

procedure SelectChoice(aIndex: Integer); override;

classtASN1GenericChoice

inherits from tASN1CustomChoice

(no public members)

classtASN1CustomData

inherits from tASN1Base

(no public members)

Types (enumerations, sets, aliases)

typetASN1StructClass

  tASN1StructClass = class of tASN1Base;

typetASN1InformationObjectClass

  tASN1InformationObjectClass = class of tASN1InformationObject;

enumtASN1TagKind

  tASN1TagKind = (atkDefault,  { the tag of the field equals the tag of the
                                 defined type of the field }
                  atkImplicit, { implicit }
                  atkExplicit, { explicit }
                  atkUndef, { ANY }
                  atkVersion, { Used if and only if fOptSpec =
                                aosExtensionVersionBegin. }
                  atkAutomatic); { Used only if fOptSpec = aosExtensionMarker

enumtASN1OptSpec

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.

  tASN1OptSpec = (aosStatic, { non-optional, non-default field of SEQUENCE
                              or SET }
                  aosOptional, { optional field of SEQUENCE or SET }
                  aosDefault, { field of SEQUENCE or SET with default value }
                  aosOptionalRead, { field of SEQUENCE or SET that is optional
                                     when read, static when written }
                  aosOptionalWrite, { choice or instance that is optional even
                                      if assigned to a field that is
                                      aosOptionalRead }
                  aosExtensionVersionBegin, { Marks start of extension section.
                                              The version number is in
                                              fTagDef.fTag  }
                  aosExtensionMarker); { Extension insertion point. If

enumtASN1RangeKind

fTagDef.fTagKind = atkAutomatic, this can only occur as the last field

  tASN1RangeKind = (arkNone,arkValue,arkLength);

typepASN1TagDefinition

  pASN1TagDefinition = ^tASN1TagDefinition;

typepASN1RangeDefinition

  pASN1RangeDefinition = ^tASN1RangeDefinition;

typepASN1FieldDefinition

  pASN1FieldDefinition = ^tASN1FieldDefinition;

typepASN1ClassDefinition

  pASN1ClassDefinition = ^tASN1ClassDefinition;

typeiDERGetBuffer

  iDERGetBuffer = iASN1Base;

arraytASN1BaseArray

  tASN1BaseArray = array of iASN1BaseField;

arraytASN1InformationObjectArray

  tASN1InformationObjectArray = array of iASN1InformationObject;

enumtASN1ReadTagState

  tASN1ReadTagState = (rtsAbsent,
                       rtsField,  // only field def of parent read
                       rtsFieldConstrMismatch, // Same, but constructed
                       rtsFieldImplicit, // field def read and it was implicit
                       rtsFieldImplicitConstrMismatch, // same, but constructed
                       rtsFirstMetaTag, // field def and first meta tag read
                       rtsFirstMetaTagConstrMismatch, // same, but constructed
                       rtsGeneric,  // field def, meta tags and actual tag read
                       rtsContent); // content read

enumtExtensionVersionStatus

  tExtensionVersionStatus = (evsUnknown,evsAbsent,evsPresent);

typetASN1DataCoderClass

  tASN1DataCoderClass = class of tASN1DataCoder;

proctASN1ClassSubstitutionMethod

  tASN1ClassSubstitutionMethod = procedure (aParentClass    : tASN1StructClass;
                                      const aFieldDefinition: tASN1FieldDefinition;
                                        var aFieldClass     : tASN1StructClass) of object;

arraytASN1FieldOffsets

  tASN1FieldOffsets = array of tASN1FieldOffset;