PKIBase.cs :  » Network-Clients » Granados » Routrek » PKI » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Network Clients » Granados 
Granados » Routrek » PKI » PKIBase.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) {}
  }


}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.