diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-30 00:28:33 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-06 20:36:02 +0200 |
| commit | c4e10c9a007345cca8594d7bfd23138d56e21d5e (patch) | |
| tree | 7ae58f6db433850666c6d2a70f112666ceea23a9 /src/lib/trusted_device.cc | |
| parent | bcb5a3f8bc060240db5573ded03e1a0521977207 (diff) | |
Move TrustedDevice to its own source files.
Diffstat (limited to 'src/lib/trusted_device.cc')
| -rw-r--r-- | src/lib/trusted_device.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/lib/trusted_device.cc b/src/lib/trusted_device.cc new file mode 100644 index 000000000..5849b8fd2 --- /dev/null +++ b/src/lib/trusted_device.cc @@ -0,0 +1,56 @@ +/* + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#include "trusted_device.h" + +using std::string; + +TrustedDevice::TrustedDevice (string thumbprint) + : _thumbprint (thumbprint) +{ + +} + +TrustedDevice::TrustedDevice (dcp::Certificate certificate) + : _certificate (certificate) +{ + +} + +string +TrustedDevice::as_string () const +{ + if (_certificate) { + return _certificate->certificate(true); + } + + return *_thumbprint; +} + +string +TrustedDevice::thumbprint () const +{ + if (_certificate) { + return _certificate->thumbprint (); + } + + return *_thumbprint; +} + |
