Add keyspecs interface and implementation
This commit is contained in:
parent
2e240e5072
commit
286818d108
21
lib/src/keyspec.dart
Normal file
21
lib/src/keyspec.dart
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user