Пример #1
0
def ft_syndicate_principal():
    """
   Functional tests for creating, reading, and deleting SyndicatePrincipals.
   """

    c_syndicate.crypto_init()

    print "generating key pair"
    pubkey_pem, privkey_pem = api.generate_key_pair(4096)

    user_email = "*****@*****.**"

    print "saving principal"

    key = generate_symmetric_secret()

    put_sealed_principal_data(user_email, key, pubkey_pem, privkey_pem)

    print "fetching principal private key"
    saved_privkey_pem = get_principal_pkey(user_email, key)

    assert saved_privkey_pem is not None, "Could not fetch saved private key"
    assert saved_privkey_pem == privkey_pem, "Saved private key does not match actual private key"

    print "delete principal"

    observer_storage.delete_principal_data(user_email)

    print "make sure its deleted..."

    saved_privkey_pem = get_principal_pkey(user_email, key)

    assert saved_privkey_pem is None, "Principal key not deleted"

    c_syndicate.crypto_shutdown()
Пример #2
0
def ft_syndicate_principal():
    """
   Functional tests for creating, reading, and deleting SyndicatePrincipals.
   """

    c_syndicate.crypto_init()

    print "generating key pair"
    pubkey_pem, privkey_pem = api.generate_key_pair(4096)

    user_email = "*****@*****.**"

    print "saving principal"

    key = generate_symmetric_secret()

    put_sealed_principal_data(user_email, key, pubkey_pem, privkey_pem)

    print "fetching principal private key"
    saved_privkey_pem = get_principal_pkey(user_email, key)

    assert saved_privkey_pem is not None, "Could not fetch saved private key"
    assert saved_privkey_pem == privkey_pem, "Saved private key does not match actual private key"

    print "delete principal"

    observer_storage.delete_principal_data(user_email)

    print "make sure its deleted..."

    saved_privkey_pem = get_principal_pkey(user_email, key)

    assert saved_privkey_pem is None, "Principal key not deleted"

    c_syndicate.crypto_shutdown()
Пример #3
0
def ensure_principal_absent(principal_id):
    """
    Ensure that a Syndicate user does not exists, and remove the OpenCloud-specific data.
    
    Return True on success.
    """

    ensure_user_absent(principal_id)
    observer_storage.delete_principal_data(principal_id)
    return True
Пример #4
0
def ensure_principal_absent(principal_id):
    """
    Ensure that a Syndicate user does not exists, and remove the OpenCloud-specific data.
    
    Return True on success.
    """

    ensure_user_absent(principal_id)
    observer_storage.delete_principal_data(principal_id)
    return True