| |
- __builtin__.object
-
- Signer
- Verifier
- exceptions.Exception(exceptions.BaseException)
-
- AppIdentityError
class Signer(__builtin__.object) |
|
Signs messages with a private key. |
|
Methods defined here:
- __init__(self, pkey)
- Constructor.
Args:
pkey, OpenSSL.crypto.PKey, The private key to sign with.
- sign(self, message)
- Signs a message.
Args:
message: string, Message to be signed.
Returns:
string, The signature of the message for the given key.
Static methods defined here:
- from_string(key, password='notasecret')
- Construct a Signer instance from a string.
Args:
key: string, private key in P12 format.
password: string, password for the private key file.
Returns:
Signer instance.
Raises:
OpenSSL.crypto.Error if the key can't be parsed.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Verifier(__builtin__.object) |
|
Verifies the signature on a message. |
|
Methods defined here:
- __init__(self, pubkey)
- Constructor.
Args:
pubkey, OpenSSL.crypto.PKey, The public key to verify with.
- verify(self, message, signature)
- Verifies a message against a signature.
Args:
message: string, The message to verify.
signature: string, The signature on the message.
Returns:
True if message was singed by the private key associated with the public
key that this object was constructed with.
Static methods defined here:
- from_string(key_pem, is_x509_cert)
- Construct a Verified instance from a string.
Args:
key_pem: string, public key in PEM format.
is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is
expected to be an RSA key in PEM format.
Returns:
Verifier instance.
Raises:
OpenSSL.crypto.Error if the key_pem can't be parsed.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |