public static BCryptSecret FromPassword(string password) { var salt = BCryptHelper.GenerateSalt(); var hash = BCryptHelper.HashPassword(password, salt); var result = new BCryptSecret(hash); return result; }
public static BCryptSecret FromPassword(string password) { var salt = BCryptHelper.GenerateSalt(); var hash = BCryptHelper.HashPassword(password, salt); var result = new BCryptSecret(hash); return(result); }
public static ISecret CreateSecret(string type, string value) { ISecret result; switch (type) { case PlainTextSecret.Name: result = new PlainTextSecret(value); break; case BCryptSecret.Name: result = new BCryptSecret(value); break; default: result = null; break; } return result; }
public static ISecret CreateSecret(string type, string value) { ISecret result; switch (type) { case PlainTextSecret.Name: result = new PlainTextSecret(value); break; case BCryptSecret.Name: result = new BCryptSecret(value); break; default: result = null; break; } return(result); }