public SymmetricKeyTokenGenerator( TokenGeneratorSettings settings, TokenValidatorSettings validatorSettings) : base(settings, validatorSettings) { signatureKey = new SymmetricSecurityKey(Convert.FromBase64String(settings.Secret)); }
protected TokenGenerator( TokenGeneratorSettings settings, TokenValidatorSettings validatorSettings) { Settings = settings; _validatorSettings = validatorSettings; handler = new JwtSecurityTokenHandler { SetDefaultTimesOnTokenCreation = false }; }
public AsymmetricKeyPairTokenGenerator( TokenGeneratorSettings settings, TokenValidatorSettings validatorSettings) : base(settings, validatorSettings) { publicKeyRsaProvider = new RSACryptoServiceProvider(KeySize); publicKeyRsaProvider.FromXmlString( Encoding.UTF8.GetString( Convert.FromBase64String(settings.Public))); publicSecurityKey = new RsaSecurityKey(publicKeyRsaProvider); privateKeyRsaProvider = new RSACryptoServiceProvider(KeySize); privateKeyRsaProvider.FromXmlString( Encoding.UTF8.GetString( Convert.FromBase64String(settings.Private))); privateSecurityKey = new RsaSecurityKey(privateKeyRsaProvider); }