⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkibase.cs

📁 Granados是一个基于.NET的SSH客户端库。同时支持SSH1和SSH2。实现了AES, Blowfish, TripleDES, RSA, DSA等加密验证算法。实现TCP协议连接。
💻 CS
字号:
/* ---------------------------------------------------------------------------
 *
 * Copyright (c) Routrek Networks, Inc.    All Rights Reserved..
 * 
 * This file is a part of the Granados SSH Client Library that is subject to
 * the license included in the distributed package.
 * You may not use this file except in compliance with the license.
 * 
 * ---------------------------------------------------------------------------
 */
using System;
using System.IO;
using System.Diagnostics;
using System.Security.Cryptography;

namespace Routrek.PKI
{

	public interface ISigner {
		byte[] Sign(byte[] data);
	}
	public interface IVerifier {
		void Verify(byte[] data, byte[] expected);
	}

	public interface IKeyWriter {
		void Write(BigInteger bi);
	}

	
	public enum PublicKeyAlgorithm {
		DSA,
		RSA
	}

	public abstract class PublicKey {
		public abstract void WriteTo(IKeyWriter writer);
		public abstract PublicKeyAlgorithm Algorithm { get; }
	}

	public abstract class KeyPair {
		
		public abstract PublicKey PublicKey { get; }
		public abstract PublicKeyAlgorithm Algorithm { get; }
	}

	public class PKIUtil {
		// OID { 1.3.14.3.2.26 }
		// iso(1) identified-org(3) OIW(14) secsig(3) alg(2) sha1(26)
		public static readonly byte[] SHA1_ASN_ID = new byte[] { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14 };
	}

	public class VerifyException : Exception {
		public VerifyException(string msg) : base(msg) {}
	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -