コード例 #1
0
        public void CanDecryptPublicKeyFromPrivateKey()
        {
            // Arrange
            var cryptoServiceSource = new AsymmetricCryptoService();
            var cryptoServiceTarget = new AsymmetricCryptoService();

            var secret = cryptoServiceSource.GenerateUserSecret();

            // Act
            var publicKey = cryptoServiceTarget.GetPublicKey(secret.PrivateKey);

            // Assert
            Assert.AreEqual(secret.PublicKey, publicKey);
        }
コード例 #2
0
 public MailboxSessionService(
     UserState userState,
     ILocalStorageService LocalStorage,
     AsymmetricCryptoService cryptoService,
     MailboxService mailboxService,
     IMessenger messenger,
     ILogger <MailboxSessionService> logger)
 {
     this.userState      = userState;
     this.localStorage   = LocalStorage;
     this.cryptoService  = cryptoService;
     this.mailboxService = mailboxService;
     this.messenger      = messenger;
     this.logger         = logger;
 }