- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListCertificatesCommand
For the specified directory, lists all the certificates registered for a secure LDAP or client certificate authentication.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DirectoryServiceClient, ListCertificatesCommand } from "@aws-sdk/client-directory-service"; // ES Modules import
// const { DirectoryServiceClient, ListCertificatesCommand } = require("@aws-sdk/client-directory-service"); // CommonJS import
const client = new DirectoryServiceClient(config);
const input = { // ListCertificatesRequest
DirectoryId: "STRING_VALUE", // required
NextToken: "STRING_VALUE",
Limit: Number("int"),
};
const command = new ListCertificatesCommand(input);
const response = await client.send(command);
// { // ListCertificatesResult
// NextToken: "STRING_VALUE",
// CertificatesInfo: [ // CertificatesInfo
// { // CertificateInfo
// CertificateId: "STRING_VALUE",
// CommonName: "STRING_VALUE",
// State: "Registering" || "Registered" || "RegisterFailed" || "Deregistering" || "Deregistered" || "DeregisterFailed",
// ExpiryDateTime: new Date("TIMESTAMP"),
// Type: "ClientCertAuth" || "ClientLDAPS",
// },
// ],
// };
ListCertificatesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DirectoryId Required | string | undefined | The identifier of the directory. |
Limit | number | undefined | The number of items that should show up on one page |
NextToken | string | undefined | A token for requesting another page of certificates if the |
ListCertificatesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CertificatesInfo | CertificateInfo[] | undefined | A list of certificates with basic details including certificate ID, certificate common name, certificate state. |
NextToken | string | undefined | Indicates whether another page of certificates is available when the number of available certificates exceeds the page limit. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ClientException | client | A client exception has occurred. |
DirectoryDoesNotExistException | client | The specified directory does not exist in the system. |
InvalidNextTokenException | client | The |
InvalidParameterException | client | One or more parameters are not valid. |
ServiceException | server | An exception has occurred in Directory Service. |
UnsupportedOperationException | client | The operation is not supported. |
DirectoryServiceServiceException | Base exception class for all service exceptions from DirectoryService service. |