Class EcdsaSignatureDescription
- Namespace
- Fdyay.IdentityServer.Saml.Xml
- Assembly
- Fdyay.IdentityServer.Saml.dll
The XML-DSig plumbing .NET does not ship: ECDSA signature descriptions for SignedXml.
public abstract class EcdsaSignatureDescription : SignatureDescription
- Inheritance
-
EcdsaSignatureDescription
- Derived
- Inherited Members
Remarks
SignedXml resolves a SignatureDescription for the SignatureMethod URI through
CryptoConfig, and the framework registers descriptions for RSA and DSA only. Handing it an
ECDsa key and the standard xmldsig-more#ecdsa-sha256 identifier therefore fails with
"SignatureDescription could not be created for the signature algorithm supplied" — not a wrong answer, but
not a signature either.
This was measured rather than remembered. 0.62.0's implementation deliberately tried the direct route first and let CI answer, because the alternative was writing crypto plumbing against a recollection of what the framework supports. The detached redirect-binding signatures needed none of this and passed on that same run — the split between the two bindings is exactly the split between our own crypto and the framework's.
Why register rather than hand-roll the verification. Going around SignedXml would
mean recomputing the reference digest and canonicalising SignedInfo by hand, which is precisely
where signature-wrapping bugs live; SamlSignature's three XSW defences are built on top of that
machinery and are worth more than the plumbing below costs. Registration is the framework's own extension
point, so the entire reference pipeline stays the framework's.
These types are public only because AddAlgorithm(Type, params string[]) constructs them by reflection and will not accept a type it cannot see. Nothing else should name them.
Constructors
EcdsaSignatureDescription(HashAlgorithmName)
Creates a description that signs and verifies with hash.
protected EcdsaSignatureDescription(HashAlgorithmName hash)
Parameters
hashHashAlgorithmName
Methods
CreateDeformatter(AsymmetricAlgorithm)
Creates an AsymmetricSignatureDeformatter instance with the specified key using the DeformatterAlgorithm property.
public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
Parameters
keyAsymmetricAlgorithmThe key to use in the AsymmetricSignatureDeformatter.
Returns
- AsymmetricSignatureDeformatter
The newly created AsymmetricSignatureDeformatter instance.
CreateDigest()
Creates a HashAlgorithm instance using the DigestAlgorithm property.
public override HashAlgorithm CreateDigest()
Returns
- HashAlgorithm
The newly created HashAlgorithm instance.
CreateFormatter(AsymmetricAlgorithm)
Creates an AsymmetricSignatureFormatter instance with the specified key using the FormatterAlgorithm property.
public override AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key)
Parameters
keyAsymmetricAlgorithmThe key to use in the AsymmetricSignatureFormatter.
Returns
- AsymmetricSignatureFormatter
The newly created AsymmetricSignatureFormatter instance.
Remarks
Constructed directly rather than through CryptoConfig, which is what the base implementation does and which would need these two types registered by name as well.