ListServerCertificates() 공개 메소드

Lists the server certificates stored in IAM that have the specified path prefix. If none exist, the action returns an empty list.

You can paginate the results using the MaxItems and Marker parameters.

For more information about working with server certificates, including a list of AWS services that can use the server certificates that you manage with IAM, go to Working with Server Certificates in the IAM User Guide.

/// The request processing has failed because of an unknown error, exception or failure. ///
public ListServerCertificates ( ) : ListServerCertificatesResponse
리턴 ListServerCertificatesResponse
        public static IEnumerable<ServerCertificateMetadata> GetServerCertificates(AwsCommonParams commonParams)
        {
            using (var client = new AmazonIdentityManagementServiceClient(
                commonParams.ResolveCredentials(),
                commonParams.RegionEndpoint))
            {
                var iamRequ = new ListServerCertificatesRequest();

                do
                {
                    var iamResp = client.ListServerCertificates(iamRequ);
                    foreach (var r in iamResp.ServerCertificateMetadataList)
                        yield return r;

                    iamRequ.Marker = iamResp.Marker;
                    if (!iamResp.IsTruncated)
                        iamRequ = null;
                } while (iamRequ != null);
            }
        }
예제 #2
0
        public DataTable GetCertDetails(string aprofile)
        {
            string accountid = GetAccountID(aprofile);
            DataTable ToReturn = AWSTables.GetCertDetailsTable();
            Amazon.Runtime.AWSCredentials credential;
            RegionEndpoint Endpoint2scan = RegionEndpoint.USEast1;
            try
            {
                credential = new Amazon.Runtime.StoredProfileAWSCredentials(aprofile);
                var iam = new AmazonIdentityManagementServiceClient(credential);
                var cervix = iam.ListServerCertificates();


                //How to get certificate details????


                foreach (var acert in cervix.ServerCertificateMetadataList)
                {
                    DataRow disone = ToReturn.NewRow();
                    disone["AccountID"] = accountid;
                    disone["Profile"] = aprofile;
                    disone["CertName"] = acert.ServerCertificateName;

                    //Cert Details
                    //disone["Status"] = acert.;
                    //disone["InUse"] = acert.xxx;
                    //disone["DomainName"] = acert.xxx;
                    //disone["AdditionalNames"] = acert.xxx;
                    disone["Identifier"] = acert.ServerCertificateId;
                    //disone["SerialNumber"] = acert.xxx;
                    //disone["AssociatedResources"] = acert.xxx;
                    //disone["RequestedAt"] = acert.xxx;
                    //disone["IssuedAt"] = acert.xxx;
                    //disone["NotBefore"] = acert.xxx;
                    disone["NotAfter"] = acert.Expiration;
                    //disone["PublicKeyInfo"] = acert.xxx;
                    //disone["SignatureAlgorithm"] = acert.xxx;
                    disone["ARN"] = acert.Arn;
                    ToReturn.Rows.Add(disone);
                }

            }//End of the big Try
            catch (Exception ex)
            {
                //Whyfor did it fail?
                string w = "";
            }

            return ToReturn;
        }