Vanetza
Loading...
Searching...
No Matches
asn1_conversions.hpp
1#pragma once
2#include <vanetza/asn1/security_profile.hpp>
3#include VANETZA_ASN1_SECURITY_HEADER(HashedId3.h)
4#include VANETZA_ASN1_SECURITY_HEADER(HashedId8.h)
5#include <vanetza/security/ecc_point.hpp>
6#include <vanetza/security/hashed_id.hpp>
7#include <vanetza/security/v3/asn1_types.hpp>
8
9
10namespace vanetza
11{
12namespace security
13{
14
15HashedId8 create_hashed_id8(const Vanetza_Security_HashedId8_t&);
16HashedId3 create_hashed_id3(const Vanetza_Security_HashedId3_t&);
17
18namespace v3
19{
20
21HashedId8 convert(const Vanetza_Security_HashedId8_t&);
22
23/**
24 * Assign ByteBuffer content to an ASN.1 OCTET_STRING
25 * \param dst destination OCTET_STRING
26 * \param src source byte buffer
27 */
28void assign(OCTET_STRING_t* dst, const ByteBuffer& src);
29
30/**
31 * Convert an EccPoint to its ASN.1 EccP256CurvePoint representation
32 * \param point ECC point to convert
33 * \return ASN.1 EccP256CurvePoint
34 */
35asn1::EccP256CurvePoint to_asn1(const EccPoint& point);
36
37} // namespace v3
38} // namespace security
39} // namespace vanetza
virtual Signature sign_digest(const PrivateKey &, const ByteBuffer &digest)=0
calculate signature for given digest and private key
virtual bool verify_digest(const PublicKey &public_key, const ByteBuffer &digest, const Signature &sig)=0
try to verify digest using public key and signature
virtual ByteBuffer calculate_hash(HashAlgorithm algo, const ByteBuffer &data)=0
calculate hash value of data
boost::optional< Certificate > canonicalize() const
boost::optional< HashedId8 > calculate_digest() const
boost::optional< HashedId8 > issuer_digest() const