public DpapiSecretStore(string storeDirectory, SecretStoreMetadata metadata) : base(metadata) { StoreDirectory = storeDirectory; _protectionDescriptor = DpapiSecretStoreProvider.GetProtectionDescriptorString(metadata.AllowedUsers); }
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)); }
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))); }