CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
ec_curve.h
1
2#pragma once
3
4#include <security/cryptography/ec_point.h>
5#include <security/cryptography/hash_algorithm_name.h>
6#include <security/cryptography/oid.h>
7#include <system/nullable.h>
8
9namespace System { namespace Security { namespace Cryptography {
10
12struct ECCurve
13{
15 enum class ECCurveType : int32_t
16 {
17 Implicit = 0,
18 PrimeShortWeierstrass = 1,
19 PrimeTwistedEdwards = 2,
20 PrimeMontgomery = 3,
21 Characteristic2 = 4,
22 Named = 5,
23 };
24
25
28
31
34
37
40
43
46
49
52
55
57 ASPOSECPP_SHARED_API SharedPtr<Oid> get_Oid() const;
58
59 ASPOSECPP_SHARED_API bool get_IsPrime() const;
60 ASPOSECPP_SHARED_API bool get_IsCharacteristic2() const;
61 ASPOSECPP_SHARED_API bool get_IsExplicit() const;
62 ASPOSECPP_SHARED_API bool get_IsNamed() const;
63
65 ASPOSECPP_SHARED_API void Validate() const;
66
68 static ASPOSECPP_SHARED_API ECCurve CreateFromOid(const SharedPtr<Oid>& oid);
69
71 static ASPOSECPP_SHARED_API ECCurve CreateFromFriendlyName(const String& oid_friendly_name);
72
74 static ASPOSECPP_SHARED_API ECCurve CreateFromValue(const String& oid_value);
75private:
76 SharedPtr<Oid> m_oid;
77
78 void set_Oid(const SharedPtr<Oid>& oid);
79 bool HasExplicitParameters() const;
80
81 static ECCurve Create(const SharedPtr<Oid>& oid);
82};
83
84}}} // namespace System::Security::Cryptography
Forward declaration.
Definition: nullable.h:74
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Definition: db_command.h:9
An elliptic curve.
Definition: ec_curve.h:13
Nullable< HashAlgorithmName > Hash
Hash algorithm.
Definition: ec_curve.h:48
ECCurveType CurveType
Curve Type.
Definition: ec_curve.h:45
ByteArrayPtr Cofactor
Cofactor.
Definition: ec_curve.h:39
ByteArrayPtr Seed
Seed.
Definition: ec_curve.h:42
static ECCurve CreateFromValue(const String &oid_value)
Create a curve from the specified OID value.
ECPoint G
Base Point.
Definition: ec_curve.h:33
ByteArrayPtr B
Coefficient B.
Definition: ec_curve.h:30
SharedPtr< Oid > get_Oid() const
Gets Oid representing the named curve.
ByteArrayPtr Prime
Prime.
Definition: ec_curve.h:54
ECCurveType
Type of elliptic curve.
Definition: ec_curve.h:16
static ECCurve CreateFromOid(const SharedPtr< Oid > &oid)
Create a curve from the specified oid.
ByteArrayPtr Order
Order of the group.
Definition: ec_curve.h:36
ByteArrayPtr Polynomial
Binary polynomial.
Definition: ec_curve.h:51
void Validate() const
Validate the current curve.
ByteArrayPtr A
Coefficient A.
Definition: ec_curve.h:27
static ECCurve CreateFromFriendlyName(const String &oid_friendly_name)
Create a curve from the specified OID firendly name.
Point on an elliptic curve.
Definition: ec_point.h:10