Add keyspecs interface and implementation

This commit is contained in:
Hugo Pointcheval 2020-12-17 22:09:27 +01:00
parent 2e240e5072
commit 286818d108

21
lib/src/keyspec.dart Normal file
View File

@ -0,0 +1,21 @@
// Copyright (c) 2020
// Author: Hugo Pointcheval
/// This represents security parameters.
abstract class KeySpec {
/// Returns the standard algorithm name for this key
String get algorithm;
}
class RSAKeySpec implements KeySpec {
int _size;
String get algorithm => "RSA";
/// Returns the size of RSA keys
int get size => _size;
RSAKeySpec(int size) {
_size = size;
}
}