Table of Contents

Class CustomAttributeCertificate

Namespace
AsmResolver.PE.Certificates
Assembly
AsmResolver.PE.dll

Represents an attribute certificate that contains a custom or unsupported certificate type or file format.

public class CustomAttributeCertificate : AttributeCertificate, ISegment, IOffsetProvider, IWritable
Inheritance
CustomAttributeCertificate
Implements
Inherited Members

Constructors

CustomAttributeCertificate(CertificateRevision, CertificateType, IReadableSegment?)

Creates a new custom attribute certificate with the provided contents.

public CustomAttributeCertificate(CertificateRevision revision, CertificateType type, IReadableSegment? contents)

Parameters

revision CertificateRevision

The revision of the file format to use.

type CertificateType

The certificate type to store.

contents IReadableSegment

The certificate data.

CustomAttributeCertificate(CertificateType, IReadableSegment?)

Creates a new custom attribute certificate with the provided contents.

public CustomAttributeCertificate(CertificateType type, IReadableSegment? contents)

Parameters

type CertificateType

The certificate type to store.

contents IReadableSegment

The certificate data.

Properties

CanRead

Gets a value indicating whether the raw contents of the signature can be read using a BinaryStreamReader instance.

public override bool CanRead { get; }

Property Value

bool

Contents

Gets or sets the raw contents of the certificate.

public IReadableSegment? Contents { get; set; }

Property Value

IReadableSegment

Revision

Gets the revision of the file format that is used for this certificate.

public override CertificateRevision Revision { get; }

Property Value

CertificateRevision

Type

Gets the type of the certificate.

public override CertificateType Type { get; }

Property Value

CertificateType

Methods

CreateContentReader()

Creates a binary reader that reads the raw contents of the stored signature.

public override BinaryStreamReader CreateContentReader()

Returns

BinaryStreamReader

The reader.

GetContentsSize()

Gets the total size in bytes of the certificate contents itself, excluding the header.

protected override uint GetContentsSize()

Returns

uint

The number of bytes.

UpdateOffsets(in RelocationParameters)

Assigns a new file and virtual offset to the segment and all its sub-components.

public override void UpdateOffsets(in RelocationParameters parameters)

Parameters

parameters RelocationParameters

The parameters containing the new offset information for the segment.

WriteContents(BinaryStreamWriter)

Writes the contents of the certificate to the provided output stream.

protected override void WriteContents(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream.