Known subclasses: twisted.internet.ssl.KeyPair

A PublicKey is a representation of the public part of a key pair.

You can't do a whole lot with it aside from comparing it to other PublicKey objects.

NoteIf constructing a PublicKey manually, be sure to pass only a crypto.PKey that does not contain a private key!
Instance Variable original The original private key.
Method __init__
Method matches Does this PublicKey contain the same value as another PublicKey?
Method __repr__ Undocumented
Method keyHash Compute a hash of the underlying PKey object.
Method inspect Undocumented
original =
The original private key.
def __init__(self, osslpkey): (source)
ParametersosslpkeyThe underlying pyOpenSSL key object. (type: crypto.PKey)
def matches(self, otherKey): (source)

Does this PublicKey contain the same value as another PublicKey?

ParametersotherKeyThe key to compare self to. (type: PublicKey)
ReturnsTrue if these keys match, False if not. (type: bool)
def __repr__(self): (source)
Undocumented
def keyHash(self): (source)

Compute a hash of the underlying PKey object.

The purpose of this method is to allow you to determine if two certificates share the same public key; it is not really useful for anything else.

In versions of Twisted prior to 15.0, keyHash used a technique involving certificate requests for computing the hash that was not stable in the face of changes to the underlying OpenSSL library.

The technique currently being used - using Netscape SPKI APIs in OpenSSL - is still somewhat dubious, but due to limitations in both pyOpenSSL and OpenSSL APIs, it is not currently possible to compute a reliable hash of the public key in isolation (i.e. not paired with a specific certificate).

ReturnsReturn a 32-character hexadecimal string uniquely identifying this public key, for this version of Twisted. (type: native str)
def inspect(self): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2015-09-04 15:29:41.