public void CreateCredential(DatabaseServer server, CredentialsSpec credentials)
        {
            var serverConn = CreateServerConnection(server);

            var newCredential = new Credential(serverConn, credentials.CredentialName);

            newCredential.Create(credentials.Identity, credentials.Secret.Value);
        }
        public void DeleteCredential(DatabaseServer server, CredentialsSpec credentials)
        {
            var serverConn    = CreateServerConnection(server);
            var oldCredential = serverConn.Credentials[credentials.CredentialName];

            if (oldCredential == null)
            {
                return;
            }
            oldCredential.DropIfExists();
        }
        public void UpdateCredential(DatabaseServer server, CredentialsSpec credential)
        {
            var serverConn = CreateServerConnection(server);

            var originalCredential = serverConn.Credentials[credential.CredentialName];

            if (originalCredential == null)
            {
                throw new ArgumentNullException("CredentialName");
            }

            originalCredential.Alter(credential.Identity, credential.Secret.Value);
        }