Example #1
0
        static void Main(string[] args)
        {
            AzureKeyVaultStore store = new AzureKeyVaultStore();

            //initialize the keystore
            //0 means basic functionality; 1 means more functionality, etc.
            //functionality levels are defined by the vendor of keystore implementation
            store.Initialize(0);

            var sizes = store.SupportedKeySizes;

            store.GenerateKeyPair(sizes[0]);

            var pubKeys = store.GetPublicKeys();

            string secret = "This is secure";

            uint keyId           = 0;
            var  encryptedSecret = store.Encrypt(ref keyId, secret);

            string[] parts = encryptedSecret.Split(new string[] { ": " }, StringSplitOptions.None);

            keyId = uint.Parse(parts[0]);

            string decryptedSecret = store.Decrypt(keyId, parts[1]);
        }
Example #2
0
        public AzureKeyVaultEncryptionProviderTests()
            : base()
        {
            var store = new AzureKeyVaultStore(AzureKeyVaultSecrets.VaultAddress
                                               , AzureKeyVaultSecrets.ClientId
                                               , AzureKeyVaultSecrets.ClientSecret);

            _sut = new AzureKeyVaultEncryptionProvider(store);
        }
Example #3
0
        static void Main(string[] args)
        {
            AzureKeyVaultStore store = new AzureKeyVaultStore();

            var sizes = store.SupportedKeySizes;
        }