The Get Certificate by Name operation returns the certificates in the system specified by the certificate ID, for the subscription ID specified in the URI
Request
The Get Certificate by Name request may be
specified as follows. Replace <subscription-id>
with your subscription ID and <certificate-id>
with your certificate ID
Method | Request URI | HTTP Version |
---|---|---|
GET |
|
HTTP/1.1 |
URI Parameters
None.
Request Headers
The following table describes request headers.
Request Header | Description |
---|---|
Authorization |
Specifies the credentials for this request. The value of this header must be set Negotiate <token>. |
Request Body
None.
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).
Response Headers
The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
Response Header | Description |
---|---|
None |
None |
Response Body
The format of the response body is as follows:
Copy Code | |
---|---|
{ "SubscriptionCertificatePublicKey": "MIGJAoGBAK/KPvvWPVO7pTfAkZGyRpDQvXJzTiIPnAZGHGytDXi/Dfuln8oXr6p9+WLd+I/BlBwCXc91T+3FCXZI0K9uwbwfshD8pQI8BOEN72wLImZF7exRxyCQFQmHDKT1v8i9ICAx+MWrlRZbKKCpS2KHO3sEA6XeorTlrJiXCVZ5r3Q3AgMBAAE=", "SubscriptionCertificateThumbprint": "E76BB7D5E465974CFA49F7CDDAFDCB22EAEF1C27", "SubscriptionCertificateData": "MIIEuzCCA6OgAwIBAgIKbE4lYwABANK6eDANBgkqhkiG9w0BAQUFADAfMR0wGwYDVQQDExRNU0lUIEVudGVycHJpc2UgQ0EgMzAeFw0xMjAyMjQwMzEyMzZaFw0xMzAyMjMwMzEyMzZaMBgxFjAUBgNVBAMTDUdlb3JnZSBNb3Vzc2EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK/KPvvWPVO7pTfAkZGyRpDQvXJzTiIPnAZGHGytDXi/Dfuln8oXr6p9+WLd+I/BlBwCXc91T+3FCXZI0K9uwbwfshD8pQI8BOEN72wLImZF7exRxyCQFQmHDKT1v8i9ICAx+MWrlRZbKKCpS2KHO3sEA6XeorTlrJiXCVZ5r3Q3AgMBAAGjggKCMIICfjA9BgkrBgEEAYI3FQcEMDAuBiYrBgEEAYI3FQiDz4lNrfIChaGfDIL6yn2B4ft0g U+HrJpPhOvFUgIBZQIBADATBgNVHSUEDDAKBggrBgEFBQcDAjALBgNVHQ8EBAMCB4AwGwYJKwYBBAGCNxUKBA4wDDAK<<truncated>> ", "TimeCreated": "2012-09-28T23:50:57.097" } |
The following table describes the key elements of the response body:
Element Name |
Description |
SubscriptionCertificatePublicKey |
The public key of the subscription certificate |
SubscriptionCertificateThumbprint |
The thumbprint of the subscription certificate |
SubscriptionCertificateData |
The subscription certificate raw data |
TimeCreated |
The time when the certificate was created |
Example
Get a certificate by name.
Copy Code | |
---|---|
public SubscriptionCertificate GetCertByName(string tenantServiceEndpoint, string subscriptionid, string thumbprint) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("TenantPortal:" + ”password”))))); string subscriptionEndpoint = tenantServiceEndpoint + "subscriptions/" + subscriptionid + "/certificates/" + thumbprint; var response = httpClient.GetAsync(subscriptionEndpoint); var resultsStr = response.Result.Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject<SubscriptionCertificate>(resultsStr); Console.WriteLine(resultsStr); return result; } |