From 286818d10806ed49c08c512090b7235edfafd8ff Mon Sep 17 00:00:00 2001 From: Pointcheval Hugo Date: Thu, 17 Dec 2020 22:09:27 +0100 Subject: [PATCH] Add keyspecs interface and implementation --- lib/src/keyspec.dart | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/src/keyspec.dart diff --git a/lib/src/keyspec.dart b/lib/src/keyspec.dart new file mode 100644 index 0000000..20b43df --- /dev/null +++ b/lib/src/keyspec.dart @@ -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; + } +}