Pro.Certificates — API for parsing certificates

Overview

The Pro.Certificates module contains a comprehensive API for parsing certificate files.

ASN.1 Objects Enumeration

The following code example shows how to enumerate all the objects in an ASN.1 DER file.

from Pro.Core import *
from Pro.Certificates import *

def enumerateObjects(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = DERObject()
    if not obj.Load(c):
        return
    class Visitor(DERObjectVisitor):
        def Visit(self, obj, oi):
            print(obj.GetObjectDescription(oi))
            print("    offset:", hex(oi.offset), "size:", hex(oi.content_size))
            return 0
    v = Visitor()
    obj.VisitObjects(v)

ASN.1 Text Output

The following code example shows how to output an ASN.1 DER file to text.

from Pro.Core import *
from Pro.Certificates import *

def outputText(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = DERObject()
    if not obj.Load(c):
        return
    out = NTTextBuffer()
    obj.OutputToText(out)
    print(out.buffer)

X509 Text Output

The following code example shows how to output an x509 certificate to text.

from Pro.Core import *
from Pro.Certificates import *

def outputText(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = X509Object()
    if not obj.Load(c):
        return
    out = NTTextBuffer()
    obj.OutputCertificateToText(out)
    print(out.buffer)

PKCS7 Text Output

Almost identically to the previous example, the following code example shows how to output a PKCS7 certificate to text.

from Pro.Core import *
from Pro.Certificates import *

def outputText(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = PKCS7Object()
    if not obj.Load(c):
        return
    out = NTTextBuffer()
    obj.OutputCertificateToText(out)
    print(out.buffer)

The only thing that changed from the previous example is the type of the object.

PEM Certificates Enumeration

The following code example shows how to enumerate the certificates in a PEM file.

from Pro.Core import *
from Pro.Certificates import *

def enumerateCertificates(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = PEMObject()
    if not obj.Load(c):
        return
    class Visitor(PEMVisitor):
        def Visit(self, obj, ci):
            print(ci.label)
            print("   format:", ci.format)
            print("   offset:", hex(ci.offset))
            print("   size:", hex(ci.size))
            print("   content offset:", hex(ci.content_offset))
            print("   content size:", hex(ci.content_size))
            return 0
    v = Visitor()
    obj.VisitCertificates(v)

Module API

Pro.Certificates module API.

Attributes:

ASN1Class_Application

Application ASN.1 object class.

ASN1Class_ContextSpecific

Context specific ASN.1 object class.

ASN1Class_Private

Private ASN.1 object class.

ASN1Class_Universal

Universal ASN.1 object class.

ASN1Tag_BMPString

ASN.1 object tag.

ASN1Tag_BitString

ASN.1 object tag.

ASN1Tag_Boolean

ASN.1 object tag.

ASN1Tag_Constructed

ASN.1 object tag.

ASN1Tag_EOC

ASN.1 object tag.

ASN1Tag_Enumerated

ASN.1 object tag.

ASN1Tag_External

ASN.1 object tag.

ASN1Tag_GeneralString

ASN.1 object tag.

ASN1Tag_GeneralizedTime

ASN.1 object tag.

ASN1Tag_GraphicString

ASN.1 object tag.

ASN1Tag_IA5String

ASN.1 object tag.

ASN1Tag_ISO64String

ASN.1 object tag.

ASN1Tag_Integer

ASN.1 object tag.

ASN1Tag_Negative

ASN.1 object tag.

ASN1Tag_NegativeEnumerated

ASN.1 object tag.

ASN1Tag_NegativeInteger

ASN.1 object tag.

ASN1Tag_Null

ASN.1 object tag.

ASN1Tag_NumericString

ASN.1 object tag.

ASN1Tag_Object

ASN.1 object tag.

ASN1Tag_ObjectDescriptor

ASN.1 object tag.

ASN1Tag_OctetString

ASN.1 object tag.

ASN1Tag_PrintableString

ASN.1 object tag.

ASN1Tag_Real

ASN.1 object tag.

ASN1Tag_Sequence

ASN.1 object tag.

ASN1Tag_Set

ASN.1 object tag.

ASN1Tag_TeletexString

ASN.1 object tag.

ASN1Tag_UTCTime

ASN.1 object tag.

ASN1Tag_UTF8String

ASN.1 object tag.

ASN1Tag_Undefined

ASN.1 object tag.

ASN1Tag_UniversalString

ASN.1 object tag.

ASN1Tag_VideotexString

ASN.1 object tag.

CSMAGIC_CERTIFICATE_SIGNATURE

Certificate signature value for the ‘magic’ blob field.

CSMAGIC_CODEDIRECTORY

Code directory value for the ‘magic’ blob field.

CSMAGIC_DETACHED_SIGNATURE

Detached signature value for the ‘magic’ blob field.

CSMAGIC_EMBEDDED_ENTITLEMENTS

Embedded entitlements value for the ‘magic’ blob field.

CSMAGIC_EMBEDDED_SIGNATURE

Embedded signature value for the ‘magic’ blob field.

CSMAGIC_EMBEDDED_SIGNATURE_OLD

Old embedded signature value for the ‘magic’ blob field.

CSMAGIC_REQUIREMENT

Requirement value for the ‘magic’ blob field.

CSMAGIC_REQUIREMENTS

Requirements value for the ‘magic’ blob field.

CSSLOT_CODEDIRECTORY

Slot index for the code directory blob.

CSSLOT_ENTITLEMENTS

Slot index for the code directory blob.

SUPPORTS_SCATTER

Version value for the ‘version’ field in the code directory blob.

Classes:

AppleCodeSignatureObject()

This class represents an Apple code signature.

DERObject()

This class represents a DER file.

DERObjectInfo()

This class contains the information about a DER ASN.1 object.

DERObjectVisitor()

This class can be inherited to enumerate the ASN.1 objects in a DER file.

DERTreeVisitor()

This class can be inherited to enumerate the ASN.1 objects in a DER tree.

PEMCertificateInfo()

This class contains the certificate information passed to PEMVisitor.Visit() about an enumerated certificate.

PEMObject()

This class represents a PEM file.

PEMVisitor()

This class can be inherited to enumerate the certificates in a PEM file.

PKCS12Object()

This class represents a PKCS12 certificate.

PKCS7Object()

This class represents a PKCS7 certificate.

X509Object()

This class represents an X509 certificate.

ASN1Class_Application: Final[int]

Application ASN.1 object class.

See also DERObjectInfo.oclass.

ASN1Class_ContextSpecific: Final[int]

Context specific ASN.1 object class.

See also DERObjectInfo.oclass.

ASN1Class_Private: Final[int]

Private ASN.1 object class.

See also DERObjectInfo.oclass.

ASN1Class_Universal: Final[int]

Universal ASN.1 object class.

See also DERObjectInfo.oclass.

ASN1Tag_BMPString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_BitString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Boolean: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Constructed: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_EOC: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Enumerated: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_External: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_GeneralString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_GeneralizedTime: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_GraphicString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_IA5String: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_ISO64String: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Integer: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Negative: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_NegativeEnumerated: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_NegativeInteger: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Null: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_NumericString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Object: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_ObjectDescriptor: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_OctetString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_PrintableString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Real: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Sequence: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Set: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_TeletexString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_UTCTime: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_UTF8String: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_Undefined: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_UniversalString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

ASN1Tag_VideotexString: Final[int]

ASN.1 object tag.

See also DERObjectInfo.tag.

class AppleCodeSignatureObject

Bases: Pro.Core.CFFObject

This class represents an Apple code signature.

Methods:

BlobFromOffset(offset)

Retrieves a blob structure from an offset.

BlobIndexes(supblob)

Returns the children blobs belonging to the specified parent blob.

BlobName(blob_or_magic)

Returns the name of a blob.

IsSuperBlob(blob_or_magic)

Checks whether a blob is parent to other blobs.

TopBlob()

Returns the structure of the top blob.

BlobFromOffset(offset: int)Pro.Core.CFFStruct

Retrieves a blob structure from an offset.

Parameters

offset (int) – The input offset.

Returns

Returns the blob structure.

Return type

CFFStruct

See also TopBlob(), IsSuperBlob() and BlobIndexes().

BlobIndexes(supblob: Pro.Core.CFFStruct)Pro.Core.CFFStruct

Returns the children blobs belonging to the specified parent blob.

Parameters

supblob (CFFStruct) – The parent blob.

Returns

Returns the array of blob structures if successful; otherwise returns an invalid Pro.Core.CFFStruct instance.

Return type

CFFStruct

See also TopBlob(), IsSuperBlob() and BlobFromOffset().

BlobName(blob_or_magic: Union[Pro.Core.CFFStruct, int])str

Returns the name of a blob.

Parameters

blob_or_magic (Union[CFFStruct, int]) – Either the structure of the blob or its ‘magic’ field.

Returns

Returns the name of the blob if known; otherwise returns 'Unknown'.

Return type

str

IsSuperBlob(blob_or_magic: Union[Pro.Core.CFFStruct, int])bool

Checks whether a blob is parent to other blobs.

Parameters

blob_or_magic (Union[CFFStruct, int]) – Either the structure of the blob to check or its ‘magic’ field.

Returns

Returns True if the blob has children; otherwise returns False.

Return type

bool

See also TopBlob() and BlobIndexes().

TopBlob()Pro.Core.CFFStruct
Returns

Returns the structure of the top blob.

Return type

CFFStruct

See also IsSuperBlob() and BlobIndexes().

CSMAGIC_CERTIFICATE_SIGNATURE: Final[int]

Certificate signature value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_CODEDIRECTORY: Final[int]

Code directory value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_DETACHED_SIGNATURE: Final[int]

Detached signature value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_EMBEDDED_ENTITLEMENTS: Final[int]

Embedded entitlements value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_EMBEDDED_SIGNATURE: Final[int]

Embedded signature value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_EMBEDDED_SIGNATURE_OLD: Final[int]

Old embedded signature value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_REQUIREMENT: Final[int]

Requirement value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSMAGIC_REQUIREMENTS: Final[int]

Requirements value for the ‘magic’ blob field.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSSLOT_CODEDIRECTORY: Final[int]

Slot index for the code directory blob.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

CSSLOT_ENTITLEMENTS: Final[int]

Slot index for the code directory blob.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

class DERObject

Bases: Pro.Core.CFFObject

This class represents a DER file.

Methods:

GetDBTree()

Returns the DER file as a Pro.Core.CFFDB instance.

GetDBTreeItemDescription(db, idx)

Retrieves the description for a Pro.Core.CFFDB index.

GetDBTreeItemInfo(db, idx)

Retrieves the object information for a Pro.Core.CFFDB index.

GetDBTreeItemOffset(db, idx)

Retrieves the object offset for a Pro.Core.CFFDB index.

GetObjectContent(offset_or_oi)

Retrieves the content of an ASN.1 object.

GetObjectDescription(offset_or_oi)

Retrieves a description for an ASN.1 object.

GetObjectInfo(offset)

Retrieves the information for an ASN.1 object.

GetTree()

Returns a tree representation of the DER file.

GetTreeNodeInfo(node)

Retrieves the object information for a node in the DER tree.

GetTreeNodesFromObjectName(name)

Retrieves a list of tree nodes matching the specified ASN.1 object name.

GetTreeNodesFromObjectSignature(sig)

Retrieves a list of tree nodes matching the specified ASN.1 object signature.

IsKnownCertificateFormat()

Returns True if the format of the certificate is known; otherwise returns False.

ObjectNameToSignature(name)

Converts an ASN.1 object name to its signature.

OutputCertificateToText(out[, offset])

Outputs a certificate to text.

OutputToText(out[, offset, single_object])

Outputs the DER file to text.

VisitObjects(visitor[, offset])

Enumerates the ASN.1 objects in a DER file.

VisitTree(visitor[, root_node])

Enumerates the ASN.1 objects in a DER tree.

GetDBTree()Pro.Core.CFFDB

Returns the DER file as a Pro.Core.CFFDB instance.

Hint

This is useful when graphically displaying the DER format in a Pro.UI.ProTreeView (see Pro.UI.ProTreeView.setDB()).

Returns

Returns the Pro.Core.CFFDB instance if successful; otherwise returns an invalid Pro.Core.CFFDB instance.

Return type

CFFDB

See also GetDBTreeItemOffset(), GetDBTreeItemInfo() and GetDBTreeItemDescription().

GetDBTreeItemDescription(db: Pro.Core.CFFDB, idx: int)str

Retrieves the description for a Pro.Core.CFFDB index.

Parameters
Returns

Returns the description for the ASN.1 object referenced by the specified index.

Return type

str

See also GetDBTree(), GetDBTreeItemOffset() and GetDBTreeItemInfo().

GetDBTreeItemInfo(db: Pro.Core.CFFDB, idx: int)Pro.Certificates.DERObjectInfo

Retrieves the object information for a Pro.Core.CFFDB index.

Parameters
Returns

Returns the information for the ASN.1 object referenced by the specified index if successful; otherwise returns an invalid DERObjectInfo instance.

Return type

DERObjectInfo

See also GetDBTree(), GetDBTreeItemOffset() and GetDBTreeItemDescription().

GetDBTreeItemOffset(db: Pro.Core.CFFDB, idx: int)int

Retrieves the object offset for a Pro.Core.CFFDB index.

Parameters
Returns

Returns the offset of the ASN.1 object referenced by the specified index.

Return type

int

See also GetDBTree(), GetDBTreeItemInfo() and GetDBTreeItemDescription().

GetObjectContent(offset_or_oi: Union[Pro.Certificates.DERObjectInfo, int])bytes

Retrieves the content of an ASN.1 object.

Parameters

offset_or_oi (Union[DERObjectInfo, int]) – Either the offset of the object or the object information.

Returns

Returns the content of the object if successful; otherwise returns an empty bytes object.

Return type

bytes

See also GetObjectInfo() and GetObjectDescription().

GetObjectDescription(offset_or_oi: Union[Pro.Certificates.DERObjectInfo, int])str

Retrieves a description for an ASN.1 object.

Parameters

offset_or_oi (Union[DERObjectInfo, int]) – Either the offset of the object or the object information.

Returns

Returns the description for the object if successful; otherwise returns an empty string.

Return type

str

See also GetObjectInfo() and GetObjectContent().

GetObjectInfo(offset: int)Pro.Certificates.DERObjectInfo

Retrieves the information for an ASN.1 object.

Parameters

offset (int) – The offset of the object.

Returns

Returns the object information if successful; otherwise returns an invalid DERObjectInfo instance.

Return type

DERObjectInfo

See also GetObjectContent() and GetObjectDescription().

GetTree()Pro.Core.NTUIntTree
Returns

Returns a tree representation of the DER file.

Return type

NTUIntTree

See also GetTreeNodeInfo(), GetTreeNodesFromObjectName(), GetTreeNodesFromObjectSignature() and VisitTree().

GetTreeNodeInfo(node: Pro.Core.NTUIntTreeNode)Pro.Certificates.DERObjectInfo

Retrieves the object information for a node in the DER tree.

Parameters

node (NTUIntTreeNode) – The tree node.

Returns

Returns the object information if successful; otherwise returns an invalid DERObjectInfo instance.

Return type

DERObjectInfo

See also GetTree(), GetTreeNodesFromObjectName(), GetTreeNodesFromObjectSignature() and VisitTree().

GetTreeNodesFromObjectName(name: str)Pro.Core.NTUIntTreeNodeList

Retrieves a list of tree nodes matching the specified ASN.1 object name.

Parameters

name (str) – The object name.

Returns

Returns the list of matching tree nodes.

Return type

NTUIntTreeNodeList

See also GetTreeNodesFromObjectSignature(), GetTree(), GetTreeNodeInfo() and VisitTree().

GetTreeNodesFromObjectSignature(sig: bytes)Pro.Core.NTUIntTreeNodeList

Retrieves a list of tree nodes matching the specified ASN.1 object signature.

Parameters

sig (bytes) – The object signature.

Returns

Returns the list of matching tree nodes.

Return type

NTUIntTreeNodeList

See also GetTreeNodesFromObjectName(), GetTree(), GetTreeNodeInfo() and VisitTree().

IsKnownCertificateFormat()bool
Returns

Returns True if the format of the certificate is known; otherwise returns False.

Return type

bool

See also OutputCertificateToText().

static ObjectNameToSignature(name: str)bytes

Converts an ASN.1 object name to its signature.

Parameters

name (str) – The ASN.1 object name.

Returns

Returns the signature if successful; otherwise returns an empty bytes object.

Return type

bytes

See also GetTreeNodesFromObjectName() and GetTreeNodesFromObjectSignature().

OutputCertificateToText(out: Pro.Core.NTTextStream, offset: int = 0)None

Outputs a certificate to text.

Hint

The current instance must be a derived class such as X509Object.

Parameters
  • out (NTTextStream) – The output stream.

  • offset (int) – The offset of the certificate.

See also IsKnownCertificateFormat().

OutputToText(out: Pro.Core.NTTextStream, offset: int = 0, single_object: bool = False)None

Outputs the DER file to text.

Parameters
  • out (NTTextStream) – The output stream.

  • offset (int) – The start offset for the output operation.

  • single_object (bool) – If True, does not enumerate child objects; otherwise enumerates child objects.

See also OutputCertificateToText() and VisitObjects().

VisitObjects(visitor: Pro.Certificates.DERObjectVisitor, offset: int = 0)int

Enumerates the ASN.1 objects in a DER file.

Parameters
Returns

Returns the value returned by DERObjectVisitor.Visit().

Return type

int

See also DERObjectVisitor and VisitTree().

VisitTree(visitor: Pro.Certificates.DERTreeVisitor, root_node: Optional[Pro.Core.NTUIntTreeNode] = None)int

Enumerates the ASN.1 objects in a DER tree.

Parameters
Returns

Returns the value returned by DERTreeVisitor.Visit().

Return type

int

See also DERTreeVisitor, GetTree(), GetTreeNodeInfo(), GetTreeNodesFromObjectName(), GetTreeNodesFromObjectSignature() and VisitObjects().

class DERObjectInfo

This class contains the information about a DER ASN.1 object.

See also DERObject and DERObjectVisitor.

Methods:

Clear()

Clears the current instance.

IsNull()

Returns True if the instance is invalid; otherwise returns False.

IsValid()

Returns True if the instance is valid; otherwise returns False.

Attributes:

content_offset

The offset of the content of the object.

content_size

The size of the content of the object.

flags

The flags of the object.

header_size

The size of the header of the object.

oclass

The class of the object (e.g., ASN1Class_Application).

offset

The offset of the object.

size

The size of the object.

tag

The tag of the object (e.g., ASN1Tag_Boolean).

Clear()None

Clears the current instance.

IsNull()bool
Returns

Returns True if the instance is invalid; otherwise returns False.

Return type

bool

See also IsValid().

IsValid()bool
Returns

Returns True if the instance is valid; otherwise returns False.

Return type

bool

See also IsNull().

content_offset

The offset of the content of the object.

content_size

The size of the content of the object.

flags

The flags of the object.

header_size

The size of the header of the object.

oclass

The class of the object (e.g., ASN1Class_Application).

offset

The offset of the object.

size

The size of the object.

tag

The tag of the object (e.g., ASN1Tag_Boolean).

class DERObjectVisitor

This class can be inherited to enumerate the ASN.1 objects in a DER file.

See also DERObject.VisitObjects().

Methods:

Visit(obj, oi)

This callback is called for each enumerated ASN.1 object.

Visit(obj: Pro.Certificates.DERObject, oi: Pro.Certificates.DERObjectInfo)int

This callback is called for each enumerated ASN.1 object.

Parameters
  • obj (DERObject) – The instance of the DER file.

  • oi (DERObjectInfo) – The information about the ASN.1 object.

Returns

Returns 0 to continue the enumeration; otherwise stops the enumeration.

Return type

int

See also* DERObjectInfo.

class DERTreeVisitor

This class can be inherited to enumerate the ASN.1 objects in a DER tree.

See also DERObject.VisitTree() and DERObject.GetTree().

Methods:

Visit(obj, tree, node)

This callback is called for each enumerated ASN.1 object.

Visit(obj: Pro.Certificates.DERObject, tree: Pro.Core.NTUIntTree, node: Pro.Core.NTUIntTreeNode)int

This callback is called for each enumerated ASN.1 object.

Parameters
  • obj (DERObject) – The instance of the DER file.

  • tree (NTUIntTree) – The instance of the DER tree.

  • node (NTUIntTreeNode) – The enumerated object node of the tree.

Returns

Returns 0 to continue the enumeration; otherwise stops the enumeration.

Return type

int

See also DERObject.GetTreeNodeInfo().

class PEMCertificateInfo

This class contains the certificate information passed to PEMVisitor.Visit() about an enumerated certificate.

See also PEMObject.VisitCertificates() and PEMVisitor.Visit().

Attributes:

content_offset

The offset of the content of the PEM certificate.

content_size

The size of the content of the PEM certificate.

format

The format of the PEM certificate.

label

The label of the PEM certificate.

offset

The offset of the PEM certificate.

size

The size of the PEM certificate.

content_offset

The offset of the content of the PEM certificate.

content_size

The size of the content of the PEM certificate.

format

The format of the PEM certificate.

label

The label of the PEM certificate.

offset

The offset of the PEM certificate.

size

The size of the PEM certificate.

class PEMObject

Bases: Pro.Core.CFFObject

This class represents a PEM file.

Methods:

VisitCertificates(visitor)

Enumerates the certificates contained in the PEM file.

VisitCertificates(visitor: Pro.Certificates.PEMVisitor)int

Enumerates the certificates contained in the PEM file.

Parameters

visitor (PEMVisitor) – The PEMVisitor derived visitor instance.

Returns

Returns the value returned by PEMVisitor.Visit().

Return type

int

See also PEMVisitor and PEMCertificateInfo.

class PEMVisitor

This class can be inherited to enumerate the certificates in a PEM file.

See also PEMObject.VisitCertificates().

Methods:

Visit(obj, ci)

This callback is called for each enumerated certificate.

Visit(obj: Pro.Certificates.PEMObject, ci: Pro.Certificates.PEMCertificateInfo)int

This callback is called for each enumerated certificate.

Parameters
Returns

Returns 0 to continue the enumeration; otherwise stops the enumeration.

Return type

int

See also PEMObject.VisitCertificates() and PEMCertificateInfo.

class PKCS12Object

Bases: Pro.Certificates.DERObject

This class represents a PKCS12 certificate.

See also DERObject and DERObject.OutputToText().

class PKCS7Object

Bases: Pro.Certificates.DERObject

This class represents a PKCS7 certificate.

See also DERObject and DERObject.OutputCertificateToText().

SUPPORTS_SCATTER: Final[int]

Version value for the ‘version’ field in the code directory blob.

See also AppleCodeSignatureObject.TopBlob() and AppleCodeSignatureObject.BlobFromOffset().

class X509Object

Bases: Pro.Certificates.DERObject

This class represents an X509 certificate.

See also DERObject and DERObject.OutputCertificateToText().