init method
Init the signer with its initialization params
. The type of CipherParameters depends on the algorithm being used (see
the documentation of each implementation to find out more).
Use the argument forSigning
to tell the signer if you want to generate or verify signatures.
Implementation
@override
void init(bool forSigning, CipherParameters params) {
_forSigning = forSigning;
AsymmetricKeyParameter akparams;
if (params is ParametersWithRandom) {
akparams = params.parameters as AsymmetricKeyParameter<AsymmetricKey>;
} else {
akparams = params as AsymmetricKeyParameter<AsymmetricKey>;
}
var k = akparams.key as RSAAsymmetricKey;
if (forSigning && (k is! RSAPrivateKey)) {
throw ArgumentError('Signing requires private key');
}
if (!forSigning && (k is! RSAPublicKey)) {
throw ArgumentError('Verification requires public key');
}
reset();
_rsa.init(forSigning, params);
}