Exemplo n.º 1
0
    def __init__(self, oid, value):
        """
        Create a subject description field for a certificate.
        :param oid: The object identifier
        :type oid: str or OID
        :param value: The value of the description field
        :type value: Blob or bytearray
        """
        if type(oid) is str:
            self._oid = OID(oid)
        else:
            # Assume oid is already an OID.
            self._oid = oid

        self._value = Blob(value)
Exemplo n.º 2
0
    def __init__(self, oid, isCritical, value):
        """
        Create a certificate extension field.
        :param oid: The object identifier for the extension
        :type oid: str or OID
        :param isCritical: Whether this extension is critical to the certificate
        :type isCritical: boolean
        :param value: The value of the extension field
        :type value: bytearray or Blob
        """
        if type(oid) is str:
            self._oid = OID(oid)
        else:
            # Assume oid is already an OID.
            self._oid = oid

        self._isCritical = isCritical
        self._value = Blob(value)