refactor(IAsymCryptHandler): Umbenannt in ICryptograph
This commit is contained in:
@@ -15,14 +15,14 @@ namespace DigitalData.Core.Security
|
||||
|
||||
private readonly TokenParams _params;
|
||||
|
||||
private readonly IAsymCryptHandler _cryptHandler;
|
||||
private readonly ICryptograph _cryptograph;
|
||||
|
||||
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, IOptions<TokenParams> tokenParamOptions, IAsymCryptHandler asymCryptHandler)
|
||||
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, IOptions<TokenParams> tokenParamOptions, ICryptograph cryptograph)
|
||||
{
|
||||
_claimDescriptor = claimDescriptorOptions.Value;
|
||||
_mapper = mapper;
|
||||
_params = tokenParamOptions.Value;
|
||||
_cryptHandler = asymCryptHandler;
|
||||
_cryptograph = cryptograph;
|
||||
}
|
||||
|
||||
public SecurityToken CreateToken(TPrincipal subject, TokenDescription description)
|
||||
@@ -38,7 +38,7 @@ namespace DigitalData.Core.Security
|
||||
var description = _params.Descriptions?.Get(issuer: issuer, audience: audience)
|
||||
?? throw new InvalidOperationException($"No or multiple token description found for issuer '{issuer}' and audience '{audience}'.");
|
||||
|
||||
description.SigningCredentials = _cryptHandler.PrivateKeys
|
||||
description.SigningCredentials = _cryptograph.PrivateKeys
|
||||
.Get(issuer: issuer, audience: audience)
|
||||
.CreateSigningCredentials(algorithm: description.SigningAlgorithm, digest: description.SigningDigest);
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace DigitalData.Core.Security
|
||||
var description = _params.Descriptions.SingleOrDefault(description => description.ApiRoute == apiRoute)
|
||||
?? throw new InvalidOperationException($"No or multiple token description found for api route '{apiRoute}'.");
|
||||
|
||||
description.SigningCredentials = _cryptHandler.PrivateKeys
|
||||
description.SigningCredentials = _cryptograph.PrivateKeys
|
||||
.Get(issuer: description.Issuer, audience: description.Audience)
|
||||
.CreateSigningCredentials(algorithm: description.SigningAlgorithm, digest: description.SigningDigest);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user