RSA topic
Asymmetric encryption: a public key encrypts, a private key decrypts.
Fortis.rsa() opens an RsaBuilder whose configuration is tracked by phantom
types. Padding and hash each move the builder into a new state, and only
RsaBuilderReady exposes encrypter and decrypter — so a builder missing
either one is a compile error, not a runtime exception.
Keys come as a FortisRsaKeyPair of FortisRsaPublicKey and
FortisRsaPrivateKey, each serializable to PEM, DER or Base64 through the
matching format enum. Generation is asynchronous because it runs off the main
thread wherever dart:isolate exists.
Classes
- FortisRsaKeyPair RSA
- A matching pair of RSA publicKey and privateKey.
- FortisRsaPrivateKey RSA
- An RSA private key used for decryption.
- FortisRsaPublicKey RSA
- An RSA public key used for encryption.
-
RsaBuilder<
P extends RsaBuilderPaddingState, H extends RsaBuilderHashState> RSA - A fluent builder for RSA operations.
- RsaBuilderHashSet RSA
- Indicates that RsaBuilder.hash has been called.
- RsaBuilderHashState RSA
- Marker base for the hash configuration state.
- RsaBuilderHashUnset RSA
- Indicates that RsaBuilder.hash has not been called yet.
- RsaBuilderPaddingSet RSA
- Indicates that RsaBuilder.padding has been called.
- RsaBuilderPaddingState RSA
- Marker base for the padding configuration state.
- RsaBuilderPaddingUnset RSA
- Indicates that RsaBuilder.padding has not been called yet.
- RsaDecrypter RSA
- Decrypts data using an RSA private key.
- RsaEncrypter RSA
- Encrypts data using an RSA public key.
Extensions
-
RsaBuilderReady
on RsaBuilder<
RsaBuilderPaddingSet, RsaBuilderHashSet> RSA - Unlocks encrypter and decrypter once both RsaBuilder.padding and RsaBuilder.hash have been called.
Enums
- RsaHash RSA
- The hash algorithm used inside RSA padding schemes (OAEP MGF1).
- RsaPadding RSA
- The RSA padding scheme used by RsaEncrypter and RsaDecrypter.
- RsaPrivateKeyFormat RSA
- The serialization format for an RSA private key.
- RsaPublicKeyFormat RSA
- The serialization format for an RSA public key.