# Returns a string containing the public key represented by this object.
def get_pubkey_string(self):
# Returns a string containing the public key represented by this object.
def get_pubkey_string(self):
return self.as_pem() == pkey.as_pem()
def sign_string(self, data):
return self.as_pem() == pkey.as_pem()
def sign_string(self, data):
k.sign_init()
k.sign_update(data)
return base64.b64encode(k.sign_final())
def verify_string(self, data, sig):
k.sign_init()
k.sign_update(data)
return base64.b64encode(k.sign_final())
def verify_string(self, data, sig):
# @param pkey is a Keypair object representing a public key. If Pkey
# did not sign the certificate, then an exception will be thrown.
# @param pkey is a Keypair object representing a public key. If Pkey
# did not sign the certificate, then an exception will be thrown.
# pyOpenSSL does not have a way to verify signatures
m2x509 = X509.load_cert_string(self.save_to_string())
# pyOpenSSL does not have a way to verify signatures
m2x509 = X509.load_cert_string(self.save_to_string())