Ejemplo n.º 1
0
        public async Task <CertificatePolicyItem> GetCertificatePolicy([ActivityTrigger] string certificateName)
        {
            CertificatePolicy certificatePolicy = await _certificateClient.GetCertificatePolicyAsync(certificateName);

            var dnsNames = certificatePolicy.SubjectAlternativeNames.DnsNames.ToArray();

            return(new CertificatePolicyItem
            {
                CertificateName = certificateName,
                DnsNames = dnsNames.Length > 0 ? dnsNames : new[] { certificatePolicy.Subject[3..] },
Ejemplo n.º 2
0
        public async Task <CertificatePolicyItem> GetCertificatePolicy([ActivityTrigger] string certificateName)
        {
            CertificatePolicy certificatePolicy = await _certificateClient.GetCertificatePolicyAsync(certificateName);

            return(new CertificatePolicyItem
            {
                CertificateName = certificateName,
                DnsNames = certificatePolicy.SubjectAlternativeNames.DnsNames.ToArray(),
                KeyType = certificatePolicy.KeyType?.ToString(),
                KeySize = certificatePolicy.KeySize,
                KeyCurveName = certificatePolicy.KeyCurveName?.ToString(),
                ReuseKey = certificatePolicy.ReuseKey
            });
        }