files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
38
src/OAuth.AspNet.Token/MonoDataProtectionProvider.cs
Normal file
38
src/OAuth.AspNet.Token/MonoDataProtectionProvider.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNet.DataProtection;
|
||||
|
||||
public class MonoDataProtectionProvider : IDataProtectionProvider
|
||||
{
|
||||
private readonly string appName;
|
||||
|
||||
public MonoDataProtectionProvider()
|
||||
: this(Guid.NewGuid().ToString())
|
||||
{ }
|
||||
|
||||
public MonoDataProtectionProvider(DirectoryInfo dataProtectionDirInfo)
|
||||
: this(Guid.NewGuid().ToString())
|
||||
{
|
||||
|
||||
}
|
||||
public MonoDataProtectionProvider(string appName)
|
||||
{
|
||||
if (appName == null) { throw new ArgumentNullException("appName"); }
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public IDataProtector Create(params string[] purposes)
|
||||
{
|
||||
if (purposes == null) { throw new ArgumentNullException("profile"); }
|
||||
|
||||
return new MonoDataProtector(appName, purposes);
|
||||
}
|
||||
|
||||
public IDataProtector CreateProtector(string purpose)
|
||||
{
|
||||
return Create(new string[] { purpose });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue