aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/filters/pk_filts/info.txt8
-rw-r--r--src/lib/filters/pk_filts/pk_filts.cpp115
-rw-r--r--src/lib/filters/pk_filts/pk_filts.h91
3 files changed, 0 insertions, 214 deletions
diff --git a/src/lib/filters/pk_filts/info.txt b/src/lib/filters/pk_filts/info.txt
deleted file mode 100644
index 688075145..000000000
--- a/src/lib/filters/pk_filts/info.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-define PUBLIC_KEY_CRYPTO 20131128
-
-load_on auto
-
-<requires>
-pubkey
-filters
-</requires>
diff --git a/src/lib/filters/pk_filts/pk_filts.cpp b/src/lib/filters/pk_filts/pk_filts.cpp
deleted file mode 100644
index 45fcc18b8..000000000
--- a/src/lib/filters/pk_filts/pk_filts.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-* PK Filters
-* (C) 1999-2009 Jack Lloyd
-*
-* Distributed under the terms of the Botan license
-*/
-
-#include <botan/pk_filts.h>
-
-namespace Botan {
-
-/*
-* Append to the buffer
-*/
-void PK_Encryptor_Filter::write(const byte input[], size_t length)
- {
- buffer += std::make_pair(input, length);
- }
-
-/*
-* Encrypt the message
-*/
-void PK_Encryptor_Filter::end_msg()
- {
- send(cipher->encrypt(buffer, rng));
- buffer.clear();
- }
-
-/*
-* Append to the buffer
-*/
-void PK_Decryptor_Filter::write(const byte input[], size_t length)
- {
- buffer += std::make_pair(input, length);
- }
-
-/*
-* Decrypt the message
-*/
-void PK_Decryptor_Filter::end_msg()
- {
- send(cipher->decrypt(buffer));
- buffer.clear();
- }
-
-/*
-* Add more data
-*/
-void PK_Signer_Filter::write(const byte input[], size_t length)
- {
- signer->update(input, length);
- }
-
-/*
-* Sign the message
-*/
-void PK_Signer_Filter::end_msg()
- {
- send(signer->signature(rng));
- }
-
-/*
-* Add more data
-*/
-void PK_Verifier_Filter::write(const byte input[], size_t length)
- {
- verifier->update(input, length);
- }
-
-/*
-* Verify the message
-*/
-void PK_Verifier_Filter::end_msg()
- {
- if(signature.empty())
- throw Invalid_State("PK_Verifier_Filter: No signature to check against");
- bool is_valid = verifier->check_signature(signature);
- send((is_valid ? 1 : 0));
- }
-
-/*
-* Set the signature to check
-*/
-void PK_Verifier_Filter::set_signature(const byte sig[], size_t length)
- {
- signature.assign(sig, sig + length);
- }
-
-/*
-* Set the signature to check
-*/
-void PK_Verifier_Filter::set_signature(const secure_vector<byte>& sig)
- {
- signature = sig;
- }
-
-/*
-* PK_Verifier_Filter Constructor
-*/
-PK_Verifier_Filter::PK_Verifier_Filter(PK_Verifier* v, const byte sig[],
- size_t length) :
- verifier(v), signature(sig, sig + length)
- {
- }
-
-/*
-* PK_Verifier_Filter Constructor
-*/
-PK_Verifier_Filter::PK_Verifier_Filter(PK_Verifier* v,
- const secure_vector<byte>& sig) :
- verifier(v), signature(sig)
- {
- }
-
-}
diff --git a/src/lib/filters/pk_filts/pk_filts.h b/src/lib/filters/pk_filts/pk_filts.h
deleted file mode 100644
index cc1c2220d..000000000
--- a/src/lib/filters/pk_filts/pk_filts.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-* PK Filters
-* (C) 1999-2009 Jack Lloyd
-*
-* Distributed under the terms of the Botan license
-*/
-
-#ifndef BOTAN_PK_FILTERS_H__
-#define BOTAN_PK_FILTERS_H__
-
-#include <botan/filter.h>
-#include <botan/pubkey.h>
-
-namespace Botan {
-
-/**
-* PK_Encryptor Filter
-*/
-class BOTAN_DLL PK_Encryptor_Filter : public Filter
- {
- public:
- void write(const byte[], size_t);
- void end_msg();
- PK_Encryptor_Filter(PK_Encryptor* c,
- RandomNumberGenerator& rng_ref) :
- cipher(c), rng(rng_ref) {}
- ~PK_Encryptor_Filter() { delete cipher; }
- private:
- PK_Encryptor* cipher;
- RandomNumberGenerator& rng;
- secure_vector<byte> buffer;
- };
-
-/**
-* PK_Decryptor Filter
-*/
-class BOTAN_DLL PK_Decryptor_Filter : public Filter
- {
- public:
- void write(const byte[], size_t);
- void end_msg();
- PK_Decryptor_Filter(PK_Decryptor* c) : cipher(c) {}
- ~PK_Decryptor_Filter() { delete cipher; }
- private:
- PK_Decryptor* cipher;
- secure_vector<byte> buffer;
- };
-
-/**
-* PK_Signer Filter
-*/
-class BOTAN_DLL PK_Signer_Filter : public Filter
- {
- public:
- void write(const byte[], size_t);
- void end_msg();
-
- PK_Signer_Filter(PK_Signer* s,
- RandomNumberGenerator& rng_ref) :
- signer(s), rng(rng_ref) {}
-
- ~PK_Signer_Filter() { delete signer; }
- private:
- PK_Signer* signer;
- RandomNumberGenerator& rng;
- };
-
-/**
-* PK_Verifier Filter
-*/
-class BOTAN_DLL PK_Verifier_Filter : public Filter
- {
- public:
- void write(const byte[], size_t);
- void end_msg();
-
- void set_signature(const byte[], size_t);
- void set_signature(const secure_vector<byte>&);
-
- PK_Verifier_Filter(PK_Verifier* v) : verifier(v) {}
- PK_Verifier_Filter(PK_Verifier*, const byte[], size_t);
- PK_Verifier_Filter(PK_Verifier*, const secure_vector<byte>&);
- ~PK_Verifier_Filter() { delete verifier; }
- private:
- PK_Verifier* verifier;
- secure_vector<byte> signature;
- };
-
-}
-
-#endif