private RsaPrivateCrtKeyParameters GetPrivateKey() { using var privateKeyReader = privateKeySource.GetPrivateKeyReader(); var pemReader = new PemReader(privateKeyReader); var keyPair = (AsymmetricCipherKeyPair)pemReader.ReadObject(); return((RsaPrivateCrtKeyParameters)keyPair.Private); }
/// <inheritdoc /> public string GetToken(int expirationSeconds = 600) { var readToEnd = _privateKeySource.GetPrivateKeyReader().ReadToEnd(); var generator = new GitHubJwtFactory( _privateKeySource, new GitHubJwtFactoryOptions { AppIntegrationId = _appIntegrationId, ExpirationSeconds = expirationSeconds } ); return(generator.CreateEncodedJwtToken()); }