def setUp(self):
        self.algorithm = 'RSA'
        self.length = 2048
        self.encoded = bytes(utils.get_public_key_der())
        self.name = 'my key'

        super(PublicKeyTestCase, self).setUp()
 def test___ne___encoded(self):
     different_encoded = bytes(utils.get_public_key_der()) + b'\x00'
     other_key = public_key.PublicKey(self.algorithm,
                                      self.length,
                                      different_encoded,
                                      self.name)
     self.assertTrue(self.key != other_key)
def _get_test_public_key():
    key_bytes = bytes(utils.get_public_key_der())
    bit_length = 2048
    key = public_key.PublicKey('RSA', bit_length, key_bytes)
    return key
def _get_test_public_key():
    key_bytes = bytes(utils.get_public_key_der())
    bit_length = 2048
    key = public_key.PublicKey('RSA', bit_length, key_bytes)
    return key
Esempio n. 5
0
    algorithm="RSA",
    bit_length=2048,
    name=u'test private key',
    created=1448088699,
    id=u'00000000-0000-0000-0000-000000000000')

nameless_private_key = objects.private_key.PrivateKey(
    key=castellan_utils.get_private_key_der(),
    algorithm="RSA",
    bit_length=2048,
    name=None,
    created=1448088699,
    id=u'11111111-1111-1111-1111-111111111111')

public_key = objects.public_key.PublicKey(
    key=castellan_utils.get_public_key_der(),
    algorithm="RSA",
    bit_length=2048,
    name=u'test public key',
    created=1448088699,
    id=u'00000000-0000-0000-0000-000000000000')

nameless_public_key = objects.public_key.PublicKey(
    key=castellan_utils.get_public_key_der(),
    algorithm="RSA",
    bit_length=2048,
    name=None,
    created=1448088699,
    id=u'11111111-1111-1111-1111-111111111111')

symmetric_key = objects.symmetric_key.SymmetricKey(