Exemplo n.º 1
0
        /// <summary>
        /// Create a certificate with the specified subject Key. Note that the template is 
        /// must be completed with calls to set validity etc. before use.
        /// </summary>
        /// <param name="SubjectKey">Cryptographic provider for the subject key.</param>
        /// <param name="Application">Certificate application(s).</param>
        public Certificate(CryptoProvider SubjectKey, Application Application) {
            _KeyPair = SubjectKey.KeyPair;
            if (SubjectKey as CryptoProviderSignature != null) {
                _CryptoProviderSignature = SubjectKey as CryptoProviderSignature;
                }
            if (SubjectKey as CryptoProviderExchange != null) {
                _CryptoProviderExchange = SubjectKey as CryptoProviderExchange;
                }

            var SubjectName = new Name(SubjectKey).ToList();
            TBSCertificate = new TBSCertificate(SubjectKey.KeyPair, SubjectName);
            }
Exemplo n.º 2
0
        /// <summary>
        /// Create a certificate with the specified subject Key. Note that the template is 
        /// must be completed with calls to set validity etc. before use.
        /// </summary>
        /// <param name="SubjectKey">Cryptographic provider for the subject key.</param>
        /// <param name="Application">Certificate application(s).</param>
        public Certificate(KeyPair SubjectKey, Application Application) {
            _KeyPair = SubjectKey;

            var SubjectName = new Name(SubjectKey).ToList();
            TBSCertificate = new TBSCertificate(SubjectKey, SubjectName);
            }
Exemplo n.º 3
0
        /// <summary>
        /// Create a certificate with the specified subject Key. Note that the template is 
        /// must be completed with calls to set validity etc. before use.
        /// </summary>
        /// <param name="SubjectKey">Cryptographic provider for the subject key.</param>
        /// <param name="Application">Certificate application(s).</param>
        /// <param name="Subject">Subject name.</param>
        /// <param name="SubjectAltName">The certificate subject altname</param>
        public Certificate(KeyPair SubjectKey, Application Application,
                    string Subject,
                    string SubjectAltName) {
            _KeyPair = SubjectKey;

            var SubjectName = new Name(Subject).ToList();
            TBSCertificate = new TBSCertificate(SubjectKey, SubjectName);
            TBSCertificate.SetProfile(Application);
            TBSCertificate.SetSubjectAltName(SubjectAltName);
            }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="CommonName"></param>
 /// <returns></returns>
 public static List<Name> ToName(string CommonName) {
     List<Name> Result = new List<Name>();
     Name Segment = new Name(CommonName);
     Result.Add(Segment);
     return Result;
     }