Ejemplo n.º 1
0
        public IActionResult Post(KeyVaultKeyEncryptEvent @event)
        {
            _logger.LogInformation("Controller calling KeyVaultKeyEncryptor.Encrypt with: KeyName = {KeyName}, Algorithm = {Algorithm}", @event.Name, @event.Algorithm);
            var result = _encryptor.Encrypt(@event.Name, @event.Data, @event.Algorithm);
            var cipher = Convert.ToBase64String(result.Ciphertext);

            return(Ok(cipher));
        }
Ejemplo n.º 2
0
        public void Encrypt_ReturnsCipherText()
        {
            var cypherText = _encryptor.Encrypt(Key.Name, Data, "RSA1_5");

            cypherText.Should().NotBeNull();
        }