Beispiel #1
0
        /// <summary>
        /// Create Certificate Signing Request.
        /// </summary>
        /// <param name="kp">KeyPair </param>
        /// <param name="subject">Subject.</param>
        /// <returns> Created GXPkcs10.</returns>
        public static GXPkcs10 CreateCertificateSigningRequest(KeyValuePair <GXPrivateKey, GXPublicKey> kp, string subject)
        {
            GXPkcs10 pkc10 = new GXPkcs10();

            pkc10.Algorithm = X9ObjectIdentifier.IdECPublicKey;
            pkc10.PublicKey = kp.Value;
            pkc10.Subject   = subject;
            pkc10.Sign(kp.Key, kp.Key.Scheme == Ecdsa.Enums.Ecc.P256 ? HashAlgorithm.Sha256WithEcdsa : HashAlgorithm.Sha384WithEcdsa);
            return(pkc10);
        }
Beispiel #2
0
        /// <summary>
        /// Create Certificate Signing Request.
        /// </summary>
        /// <param name="kp">KeyPair </param>
        /// <param name="subject">Subject.</param>
        /// <returns> Created GXPkcs10.</returns>
        public static GXPkcs10 CreateCertificateSigningRequest(KeyValuePair <GXPrivateKey, GXPublicKey> kp, string subject)
        {
            GXPkcs10 pkc10 = new GXPkcs10();

            pkc10.Algorithm = X9ObjectIdentifier.IdECPublicKey;
            pkc10.PublicKey = kp.Value;
            pkc10.Subject   = subject;
            pkc10.Sign(kp.Key, HashAlgorithm.Sha256withecdsa);
            return(pkc10);
        }