CryptographyProviders Class
Namespace: Yubico.YubiKey.Cryptography Assembly: Yubico.YubiKey.dllThis class contains properties that specify cryptographic providers.
public static class CryptographyProviders : Object
Remarks
During the course of operations, the SDK will need to perform cryptographic operations, such as random number generation, HMAC, Triple-DES encryption, and so on. Any SDK operation that needs crypto will get it from this class.
The properties in this class are delegates. They are functions that can
build objects that will perform the required crypto. The reason these
properties are methods that build objects, rather than objects
themselves, is because the crypto classes implement IDisposable
.
In order to avoid the complex problem of ownership of an object that will
be disposed once it goes out of scope, the SDK will create a new object
each time one is needed. This new object will be in scope only for the
duration of its use in the SDK, and will be disposed immediately when the
SDK is done with it.
This class will return default implementations, but can be replaced. That is, if you do nothing, the SDK will use default C# cryptography. If you want the SDK to use your own implementations, you can do so. See the User's Manual entry on alternate crypto implementations for a detailed description of replacing the defaults. Generally, you will simply need to set the appropriate property with a new function.
Most applications will not replace the defaults, but for those that want the SDK to use a hardware RNG, hardware accelerator, or any other specific implementation for whatever reason, it is possible.
Properties
Name | Description |
---|---|
AesCreator | This property is a delegate (function pointer). The method loaded
will return an instance of |
AesGcmPrimitivesCreator | This property is a delegate (function pointer). This method will return an instance of IAesGcmPrimitives. |
CmacPrimitivesCreator | This property is a delegate (function pointer). This method will return an instance of ICmacPrimitives, built to use the specified algorithm. |
DesCreator | This property is a delegate (function pointer). The method loaded
will return an instance of |
EcdhPrimitivesCreator | This property is a delegate (function pointer). This method will return an instance of IEcdhPrimitives. |
HmacCreator | This property is a delegate (function pointer). This method will return
an instance of |
RngCreator | This property is a delegate (function pointer). The method loaded
will return an instance of |
Sha1Creator | This property is a delegate (function pointer). The method loaded
will return an instance of |
Sha256Creator | This property is a delegate (function pointer). The method loaded
will return an instance of |
Sha384Creator | This property is a delegate (function pointer). The method loaded
will return an instance of |
Sha512Creator | This property is a delegate (function pointer). The method loaded
will return an instance of |
TripleDesCreator | This property is a delegate (function pointer). The method loaded
will return an instance of |