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
CertificateRevisionThe revision of the file format to use.
type
CertificateTypeThe certificate type to store.
contents
IReadableSegmentThe certificate data.
CustomAttributeCertificate(CertificateType, IReadableSegment?)
Creates a new custom attribute certificate with the provided contents.
public CustomAttributeCertificate(CertificateType type, IReadableSegment? contents)
Parameters
type
CertificateTypeThe certificate type to store.
contents
IReadableSegmentThe 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
Contents
Gets or sets the raw contents of the certificate.
public IReadableSegment? Contents { get; set; }
Property Value
Revision
Gets the revision of the file format that is used for this certificate.
public override CertificateRevision Revision { get; }
Property Value
Type
Gets the type of the certificate.
public override CertificateType Type { get; }
Property Value
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
RelocationParametersThe 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
BinaryStreamWriterThe output stream.