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:
Application ASN.1 object class.
Context specific ASN.1 object class.
Private ASN.1 object class.
Universal ASN.1 object class.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
ASN.1 object tag.
Certificate signature value for the ‘magic’ blob field.
Code directory value for the ‘magic’ blob field.
Detached signature value for the ‘magic’ blob field.
Embedded entitlements value for the ‘magic’ blob field.
Embedded signature value for the ‘magic’ blob field.
Old embedded signature value for the ‘magic’ blob field.
Requirement value for the ‘magic’ blob field.
Requirements value for the ‘magic’ blob field.
Slot index for the code directory blob.
Slot index for the code directory blob.
Version value for the ‘version’ field in the code directory blob.
Classes:
This class represents an Apple code signature.
This class represents a DER file.
This class contains the information about a DER ASN.1 object.
This class can be inherited to enumerate the ASN.1 objects in a DER file.
This class can be inherited to enumerate the ASN.1 objects in a DER tree.
This class contains the certificate information passed to
PEMVisitor.Visit()
about an enumerated certificate.This class represents a PEM file.
This class can be inherited to enumerate the certificates in a PEM file.
This class represents a PKCS12 certificate.
This class represents a PKCS7 certificate.
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
See also
TopBlob()
,IsSuperBlob()
andBlobIndexes()
.
- 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
See also
TopBlob()
,IsSuperBlob()
andBlobFromOffset()
.
- 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 returnsFalse
.- Return type
bool
See also
TopBlob()
andBlobIndexes()
.
- TopBlob() → Pro.Core.CFFStruct¶
- Returns
Returns the structure of the top blob.
- Return type
See also
IsSuperBlob()
andBlobIndexes()
.
- CSMAGIC_CERTIFICATE_SIGNATURE: Final[int]¶
Certificate signature value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_CODEDIRECTORY: Final[int]¶
Code directory value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_DETACHED_SIGNATURE: Final[int]¶
Detached signature value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_EMBEDDED_ENTITLEMENTS: Final[int]¶
Embedded entitlements value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_EMBEDDED_SIGNATURE: Final[int]¶
Embedded signature value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_EMBEDDED_SIGNATURE_OLD: Final[int]¶
Old embedded signature value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_REQUIREMENT: Final[int]¶
Requirement value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSMAGIC_REQUIREMENTS: Final[int]¶
Requirements value for the ‘magic’ blob field.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSSLOT_CODEDIRECTORY: Final[int]¶
Slot index for the code directory blob.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- CSSLOT_ENTITLEMENTS: Final[int]¶
Slot index for the code directory blob.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- class DERObject¶
Bases:
Pro.Core.CFFObject
This class represents a DER file.
Methods:
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.
Retrieves a list of tree nodes matching the specified ASN.1 object name.
Retrieves a list of tree nodes matching the specified ASN.1 object signature.
Returns
True
if the format of the certificate is known; otherwise returnsFalse
.
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
(seePro.UI.ProTreeView.setDB()
).
- Returns
Returns the
Pro.Core.CFFDB
instance if successful; otherwise returns an invalidPro.Core.CFFDB
instance.- Return type
See also
GetDBTreeItemOffset()
,GetDBTreeItemInfo()
andGetDBTreeItemDescription()
.
- GetDBTreeItemDescription(db: Pro.Core.CFFDB, idx: int) → str¶
Retrieves the description for a
Pro.Core.CFFDB
index.
- Parameters
db (CFFDB) – The
Pro.Core.CFFDB
instance.idx (int) – The index.
- Returns
Returns the description for the ASN.1 object referenced by the specified index.
- Return type
str
See also
GetDBTree()
,GetDBTreeItemOffset()
andGetDBTreeItemInfo()
.
- GetDBTreeItemInfo(db: Pro.Core.CFFDB, idx: int) → Pro.Certificates.DERObjectInfo¶
Retrieves the object information for a
Pro.Core.CFFDB
index.
- Parameters
db (CFFDB) – The
Pro.Core.CFFDB
instance.idx (int) – The index.
- Returns
Returns the information for the ASN.1 object referenced by the specified index if successful; otherwise returns an invalid
DERObjectInfo
instance.- Return type
See also
GetDBTree()
,GetDBTreeItemOffset()
andGetDBTreeItemDescription()
.
- GetDBTreeItemOffset(db: Pro.Core.CFFDB, idx: int) → int¶
Retrieves the object offset for a
Pro.Core.CFFDB
index.
- Parameters
db (CFFDB) – The
Pro.Core.CFFDB
instance.idx (int) – The index.
- Returns
Returns the offset of the ASN.1 object referenced by the specified index.
- Return type
int
See also
GetDBTree()
,GetDBTreeItemInfo()
andGetDBTreeItemDescription()
.
- 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()
andGetObjectDescription()
.
- 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()
andGetObjectContent()
.
- 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
See also
GetObjectContent()
andGetObjectDescription()
.
- GetTree() → Pro.Core.NTUIntTree¶
- Returns
Returns a tree representation of the DER file.
- Return type
See also
GetTreeNodeInfo()
,GetTreeNodesFromObjectName()
,GetTreeNodesFromObjectSignature()
andVisitTree()
.
- 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
See also
GetTree()
,GetTreeNodesFromObjectName()
,GetTreeNodesFromObjectSignature()
andVisitTree()
.
- 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
See also
GetTreeNodesFromObjectSignature()
,GetTree()
,GetTreeNodeInfo()
andVisitTree()
.
- 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
See also
GetTreeNodesFromObjectName()
,GetTree()
,GetTreeNodeInfo()
andVisitTree()
.
- IsKnownCertificateFormat() → bool¶
- Returns
Returns
True
if the format of the certificate is known; otherwise returnsFalse
.- 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()
andGetTreeNodesFromObjectSignature()
.
- 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()
andVisitObjects()
.
- VisitObjects(visitor: Pro.Certificates.DERObjectVisitor, offset: int = 0) → int¶
Enumerates the ASN.1 objects in a DER file.
- Parameters
visitor (DERObjectVisitor) – The
DERObjectVisitor
derived visitor instance.offset (int) – The start offset.
- Returns
Returns the value returned by
DERObjectVisitor.Visit()
.- Return type
int
See also
DERObjectVisitor
andVisitTree()
.
- VisitTree(visitor: Pro.Certificates.DERTreeVisitor, root_node: Optional[Pro.Core.NTUIntTreeNode] = None) → int¶
Enumerates the ASN.1 objects in a DER tree.
- Parameters
visitor (DERTreeVisitor) – The
DERTreeVisitor
derived visitor instance.root_node (NTUIntTreeNode) – The root node.
- Returns
Returns the value returned by
DERTreeVisitor.Visit()
.- Return type
int
See also
DERTreeVisitor
,GetTree()
,GetTreeNodeInfo()
,GetTreeNodesFromObjectName()
,GetTreeNodesFromObjectSignature()
andVisitObjects()
.
- class DERObjectInfo¶
This class contains the information about a DER ASN.1 object.
See also
DERObject
andDERObjectVisitor
.Methods:
Clear
()Clears the current instance.
IsNull
()Returns
True
if the instance is invalid; otherwise returnsFalse
.
IsValid
()Returns
True
if the instance is valid; otherwise returnsFalse
.Attributes:
The offset of the content of the object.
The size of the content of the object.
The flags of the object.
The size of the header of the object.
The class of the object (e.g.,
ASN1Class_Application
).The offset of the object.
The size of the object.
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 returnsFalse
.- Return type
bool
See also
IsValid()
.
- IsValid() → bool¶
- Returns
Returns
True
if the instance is valid; otherwise returnsFalse
.- 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()
andDERObject.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()
andPEMVisitor.Visit()
.Attributes:
The offset of the content of the PEM certificate.
The size of the content of the PEM certificate.
The format of the PEM certificate.
The label of the PEM certificate.
The offset of the PEM certificate.
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
andPEMCertificateInfo
.
- 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
obj (PEMObject) – The instance of the PEM file.
ci (PEMCertificateInfo) – The certificate information.
- Returns
Returns
0
to continue the enumeration; otherwise stops the enumeration.- Return type
int
See also
PEMObject.VisitCertificates()
andPEMCertificateInfo
.
- class PKCS12Object¶
Bases:
Pro.Certificates.DERObject
This class represents a PKCS12 certificate.
See also
DERObject
andDERObject.OutputToText()
.
- class PKCS7Object¶
Bases:
Pro.Certificates.DERObject
This class represents a PKCS7 certificate.
See also
DERObject
andDERObject.OutputCertificateToText()
.
- SUPPORTS_SCATTER: Final[int]¶
Version value for the ‘version’ field in the code directory blob.
See also
AppleCodeSignatureObject.TopBlob()
andAppleCodeSignatureObject.BlobFromOffset()
.
- class X509Object¶
Bases:
Pro.Certificates.DERObject
This class represents an X509 certificate.
See also
DERObject
andDERObject.OutputCertificateToText()
.