TBSCertificate
상속: Goedel.ASN1.Root
예제 #1
0
 /// <summary>
 /// Create a certificate from binary data. 
 /// </summary>
 /// <param name="Data">Binary certificate data</param>
 public Certificate(byte[] Data) {
     //Goedel.Debug.Trace.WriteLine(Convert.ToBase64String(Data));
     _Data = Data;
     var X509Cert = new X509Certificate2(Data);
     _KeyPair = KeyPair.GetKeyPair(X509Cert.PublicKey.Key);
     TBSCertificate = new TBSCertificate(X509Cert);
     }
예제 #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>
        /// <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);
            }
예제 #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>
        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);
            }
예제 #4
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);
            }