C# Class Conjur.Client

Conjur API client.
Datei anzeigen Open project: conjurinc/api-dotnet Class Usage Examples

Public Methods

Method Description
AuthenticatedRequest ( string path ) : WebRequest

Create an authenticated WebRequest for the specified path.

Client ( string applianceUri ) : System

Initializes a new instance of the Conjur.Client class.

CreateHost ( string name, string hostFactoryToken ) : Host

Creates a host using a host factory token.

GetAccountName ( ) : string

Gets the name of the Conjur organization account.

LogIn ( NetworkCredential credential ) : string

Logs in using a password. Sets Authenticator Credential

LogIn ( string userName, string password ) : string

Logs in using a password. Sets Authenticator Credential

Request ( string path ) : WebRequest

Create a WebRequest for the specified path.

Resource ( string kind, string id ) : Resource

Creates an object representing a Conjur resource.

ValidateBaseUri ( ) : Uri

Validates the appliance base URI. Tries to connect to /info; if not successful, try again adding an /api prefix. Also sets up certificate validation.

Variable ( string name ) : Variable

Creates an object representing the named variable.

Private Methods

Method Description
ApplyAuthentication ( WebRequest webRequest ) : WebRequest
Info ( ) : ServerInfo

Get the server info.

NormalizeBaseUri ( string uri ) : Uri

Normalizes the base URI, removing double slashes and adding a trailing slash, as necessary.

ValidateCertificate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool

Validates the Conjur appliance certificate. RemoteCertificateValidationCallback

Method Details

AuthenticatedRequest() public method

Create an authenticated WebRequest for the specified path.
public AuthenticatedRequest ( string path ) : WebRequest
path string Path, NOT including the leading slash.
return System.Net.WebRequest

Client() public method

Initializes a new instance of the Conjur.Client class.
public Client ( string applianceUri ) : System
applianceUri string Appliance URI.
return System

CreateHost() public method

Creates a host using a host factory token.
public CreateHost ( string name, string hostFactoryToken ) : Host
name string Name of the host to create.
hostFactoryToken string Host factory token.
return Host

GetAccountName() public method

Gets the name of the Conjur organization account.
public GetAccountName ( ) : string
return string

LogIn() public method

Logs in using a password. Sets Authenticator Credential
public LogIn ( NetworkCredential credential ) : string
credential System.Net.NetworkCredential The credential of user name and password, /// where user name is for example "bob" or "host/jenkins".
return string

LogIn() public method

Logs in using a password. Sets Authenticator Credential
public LogIn ( string userName, string password ) : string
userName string User name to log in as (for example "bob" /// or "host/example.com".
password string Password of the user.
return string

Request() public method

Create a WebRequest for the specified path.
public Request ( string path ) : WebRequest
path string Path, NOT including the leading slash.
return System.Net.WebRequest

Resource() public method

Creates an object representing a Conjur resource.
public Resource ( string kind, string id ) : Resource
kind string Resource kind.
id string Resource identifier.
return Resource

ValidateBaseUri() public method

Validates the appliance base URI. Tries to connect to /info; if not successful, try again adding an /api prefix. Also sets up certificate validation.
public ValidateBaseUri ( ) : Uri
return System.Uri

Variable() public method

Creates an object representing the named variable.
public Variable ( string name ) : Variable
name string The variable name.
return Variable