Пример #1
0
 public E2ERatchet(string myId, byte[] myStaticPrivateKey, IVisualCrypt2Service visualCrypt2Service, Func <string, Task <E2EUser> > getUser, Func <E2EUser, Task> updateUser)
 {
     this.MyId = myId;
     this._myStaticPrivateKey  = myStaticPrivateKey;
     this._visualCrypt2Service = visualCrypt2Service;
     this._gu         = getUser;
     this._updateUser = updateUser;
 }
Пример #2
0
 public TLSClientRatchet(string myId, byte[] myPrivateKey, TLSUser server, IVisualCrypt2Service visualCrypt2Service)
 {
     Guard.NotNull(myId, myPrivateKey, server, visualCrypt2Service);
     Guard.NotNull(server.StaticPublicKey);
     this.MyId                 = myId;
     this._myIdBytes           = Encoding.UTF8.GetBytes(this.MyId);
     this._server              = server;
     this._visualCrypt2Service = visualCrypt2Service;
     this._server.AuthSecret   = this._visualCrypt2Service.CalculateAndHashSharedSecret(myPrivateKey, this._server.StaticPublicKey);
 }
Пример #3
0
 public static IVisualCrypt2Service Instance()
 {
     if (_visualCrypt2Service == null)
     {
         lock (lockObject)
         {
             if (_visualCrypt2Service == null)
             {
                 _visualCrypt2Service = new VisualCrypt2Service();
                 _visualCrypt2Service.Init(new Platform_NetStandard());
             }
         }
     }
     return(_visualCrypt2Service);
 }
Пример #4
0
 public TLSServerRatchet(string serverId, byte[] serverPrivateKey, IVisualCrypt2Service visualCrypt2Service)
 {
     this.ServerId             = serverId;
     this._serverPrivateKey    = serverPrivateKey;
     this._visualCrypt2Service = visualCrypt2Service;
 }