Inheritance: SecretStoreProvider
Example #1
0
        public DpapiSecretStore(string storeDirectory, SecretStoreMetadata metadata)
            : base(metadata)
        {
            StoreDirectory = storeDirectory;

            _protectionDescriptor = DpapiSecretStoreProvider.GetProtectionDescriptorString(metadata.AllowedUsers);
        }
Example #2
0
        private Task UnauditedWriteSecret(Secret secret)
        {
            // Generate the name of the file
            string secretFile = GetFileName(secret.Name);

            // Write the file
            var protector = CreateProtector(secret.Name);

            return(DpapiSecretStoreProvider.WriteSecretFile(secretFile, JsonFormat.Serialize(secret), protector));
        }
Example #3
0
        private async Task <Secret> UnauditedReadSecret(SecretName name, string fileName)
        {
            if (!File.Exists(fileName))
            {
                return(null);
            }

            // Read the file
            var protector = CreateProtector(name);

            return(JsonFormat.Deserialize <Secret>(await DpapiSecretStoreProvider.ReadSecretFile(fileName, protector)));
        }