aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/Crypto/src/ECKey.cpp
blob: 56b8663776e7c0bda05e48aedde9cfaf08cd9d00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// ECKey.cpp
//
//
// Library: Crypto
// Package: EC
// Module:  ECKey
//
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
//


#include "Poco/Crypto/ECKey.h"
#include <openssl/rsa.h>


namespace Poco {
namespace Crypto {


ECKey::ECKey(const EVPPKey& key):
	KeyPair(new ECKeyImpl(key)),
	_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::ECKey(const X509Certificate& cert):
	KeyPair(new ECKeyImpl(cert)),
	_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::ECKey(const PKCS12Container& cont):
	KeyPair(new ECKeyImpl(cont)),
	_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::ECKey(const std::string& eccGroup):
	KeyPair(new ECKeyImpl(OBJ_txt2nid(eccGroup.c_str()))),
	_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::ECKey(const std::string& publicKeyFile,
	const std::string& privateKeyFile,
	const std::string& privateKeyPassphrase):
		KeyPair(new ECKeyImpl(publicKeyFile, privateKeyFile, privateKeyPassphrase)),
		_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::ECKey(std::istream* pPublicKeyStream,
	std::istream* pPrivateKeyStream,
	const std::string& privateKeyPassphrase):
		KeyPair(new ECKeyImpl(pPublicKeyStream, pPrivateKeyStream, privateKeyPassphrase)),
		_pImpl(KeyPair::impl().cast<ECKeyImpl>())
{
}


ECKey::~ECKey()
{
}


} } // namespace Poco::Crypto