Exemple #1
0
def _build_ekey_from_string(key):
	bio = _string_to_bio(key)
	ekey = evp.PEM_read_bio_PUBKEY(bio, None, None, None)
	if not ekey:
		raise EnvelopeError("Could not create encryption key from string")
	evp.BIO_free(bio)
	return ekey
Exemple #2
0
def _build_dkey_from_string(key):
	bio = _string_to_bio(key)
	dkey = evp.PEM_read_bio_PrivateKey(bio, None, None, None)
	if not dkey:
		raise EnvelopeError("Could not build decryption key from string")
	evp.BIO_free(bio)
	return dkey