< Summary

Class:Microsoft.Azure.KeyVault.Models.CertificateBundle
Assembly:Microsoft.Azure.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Customized\CertificateBundle.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Generated\Models\CertificateBundle.cs
Covered lines:18
Uncovered lines:28
Coverable lines:46
Total lines:198
Line coverage:39.1% (18 of 46)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Id()-100%100%
get_Kid()-100%100%
get_Sid()-100%100%
get_X509Thumbprint()-100%100%
get_Policy()-100%100%
get_Cer()-100%100%
get_ContentType()-100%100%
get_Attributes()-100%100%
get_Tags()-100%100%
Validate()-100%100%
get_SecretIdentifier()-66.67%50%
.ctor()-100%50%
get_KeyIdentifier()-75%50%
get_CertificateIdentifier()-66.67%50%
.ctor(...)-0%100%
.ctor()-100%100%
.ctor(...)-0%100%
get_Id()-100%100%
get_Kid()-100%100%
get_Sid()-100%100%
get_X509Thumbprint()-100%100%
get_Policy()-100%100%
get_Cer()-100%100%
get_ContentType()-0%100%
get_Attributes()-100%100%
get_Tags()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Customized\CertificateBundle.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.KeyVault.Models
 6{
 7    public partial class CertificateBundle
 8    {
 9        /// <summary>
 10        /// This is the Id of the secret backing the certificate.
 11        /// </summary>
 12        public SecretIdentifier SecretIdentifier
 13        {
 14            get
 15            {
 6016                if (!string.IsNullOrWhiteSpace(Sid))
 6017                    return new SecretIdentifier(Sid);
 18                else
 019                    return null;
 20            }
 21        }
 22
 23        /// <summary>
 24        /// This is the Id of the key backing the certificate.
 25        /// </summary>
 26        public KeyIdentifier KeyIdentifier
 27        {
 28            get
 4929            {
 4830                if (!string.IsNullOrWhiteSpace(Kid))
 4831                    return new KeyIdentifier(Kid);
 4932                else
 033                    return null;
 34            }
 35        }
 36
 37        /// <summary>
 38        /// This is the Id of the certificate.
 39        /// </summary>
 40        public CertificateIdentifier CertificateIdentifier
 41        {
 42            get
 43            {
 1044                if (!string.IsNullOrWhiteSpace(Id))
 1045                    return new CertificateIdentifier(Id);
 46                else
 047                    return null;
 48            }
 049        }
 050    }
 051
 052    /// <summary>
 053    /// Media types relevant to certificates.
 054    /// </summary>
 055    public static class CertificateContentType
 056    {
 057        public const string Pfx = "application/x-pkcs12";
 58        public const string Pem = "application/x-pem-file";
 059
 60        public static readonly string[] AllTypes = { Pfx, Pem };
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Generated\Models\CertificateBundle.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.KeyVault.Models
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Serialization;
 15    using Newtonsoft.Json;
 16    using System.Collections;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// A certificate bundle consists of a certificate (X509) plus its
 22    /// attributes.
 23    /// </summary>
 24    public partial class CertificateBundle
 25    {
 26        /// <summary>
 27        /// Initializes a new instance of the CertificateBundle class.
 28        /// </summary>
 4929        public CertificateBundle()
 30        {
 31            CustomInit();
 4932        }
 33
 34        /// <summary>
 35        /// Initializes a new instance of the CertificateBundle class.
 36        /// </summary>
 37        /// <param name="id">The certificate id.</param>
 38        /// <param name="kid">The key id.</param>
 39        /// <param name="sid">The secret id.</param>
 40        /// <param name="x509Thumbprint">Thumbprint of the certificate.</param>
 41        /// <param name="policy">The management policy.</param>
 42        /// <param name="cer">CER contents of x509 certificate.</param>
 43        /// <param name="contentType">The content type of the secret.</param>
 44        /// <param name="attributes">The certificate attributes.</param>
 45        /// <param name="tags">Application specific metadata in the form of
 46        /// key-value pairs</param>
 047        public CertificateBundle(string id = default(string), string kid = default(string), string sid = default(string)
 48        {
 049            Id = id;
 050            Kid = kid;
 051            Sid = sid;
 052            X509Thumbprint = x509Thumbprint;
 053            Policy = policy;
 054            Cer = cer;
 055            ContentType = contentType;
 056            Attributes = attributes;
 057            Tags = tags;
 58            CustomInit();
 059        }
 60
 61        /// <summary>
 62        /// An initialization method that performs custom operations like setting defaults
 63        /// </summary>
 64        partial void CustomInit();
 65
 66        /// <summary>
 67        /// Gets the certificate id.
 68        /// </summary>
 69        [JsonProperty(PropertyName = "id")]
 6770        public string Id { get; private set; }
 71
 72        /// <summary>
 73        /// Gets the key id.
 74        /// </summary>
 75        [JsonProperty(PropertyName = "kid")]
 9776        public string Kid { get; private set; }
 77
 78        /// <summary>
 79        /// Gets the secret id.
 80        /// </summary>
 81        [JsonProperty(PropertyName = "sid")]
 10882        public string Sid { get; private set; }
 83
 84        /// <summary>
 85        /// Gets thumbprint of the certificate.
 86        /// </summary>
 87        [JsonConverter(typeof(Base64UrlJsonConverter))]
 88        [JsonProperty(PropertyName = "x5t")]
 14189        public byte[] X509Thumbprint { get; private set; }
 90
 91        /// <summary>
 92        /// Gets the management policy.
 93        /// </summary>
 94        [JsonProperty(PropertyName = "policy")]
 10895        public CertificatePolicy Policy { get; private set; }
 96
 97        /// <summary>
 98        /// Gets or sets CER contents of x509 certificate.
 99        /// </summary>
 100        [JsonProperty(PropertyName = "cer")]
 78101        public byte[] Cer { get; set; }
 102
 103        /// <summary>
 104        /// Gets or sets the content type of the secret.
 105        /// </summary>
 106        [JsonProperty(PropertyName = "contentType")]
 0107        public string ContentType { get; set; }
 108
 109        /// <summary>
 110        /// Gets or sets the certificate attributes.
 111        /// </summary>
 112        [JsonProperty(PropertyName = "attributes")]
 107113        public CertificateAttributes Attributes { get; set; }
 114
 115        /// <summary>
 116        /// Gets or sets application specific metadata in the form of key-value
 117        /// pairs
 118        /// </summary>
 119        [JsonProperty(PropertyName = "tags")]
 13120        public IDictionary<string, string> Tags { get; set; }
 121
 122        /// <summary>
 123        /// Validate the object.
 124        /// </summary>
 125        /// <exception cref="ValidationException">
 126        /// Thrown if validation fails
 127        /// </exception>
 128        public virtual void Validate()
 129        {
 0130            if (Policy != null)
 131            {
 0132                Policy.Validate();
 133            }
 0134        }
 135    }
 136}