2020-04-08 22:09:48 +00:00
|
|
|
/*
|
2021-04-22 20:13:01 +00:00
|
|
|
* Copyright (c) 2020, Ali Mohammad Pur <mpfard@serenityos.org>
|
2020-04-08 22:09:48 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-08 22:09:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-07-27 13:20:27 +00:00
|
|
|
#include <AK/Span.h>
|
2020-04-08 22:09:48 +00:00
|
|
|
#include <LibCrypto/ASN1/ASN1.h>
|
|
|
|
#include <LibCrypto/ASN1/DER.h>
|
|
|
|
|
|
|
|
namespace Crypto {
|
|
|
|
|
2023-04-01 19:20:29 +00:00
|
|
|
enum PEMType {
|
|
|
|
Certificate,
|
|
|
|
PrivateKey,
|
|
|
|
};
|
|
|
|
|
2021-02-14 11:20:42 +00:00
|
|
|
ByteBuffer decode_pem(ReadonlyBytes);
|
2023-03-13 11:18:14 +00:00
|
|
|
ErrorOr<Vector<ByteBuffer>> decode_pems(ReadonlyBytes);
|
2023-04-01 19:20:29 +00:00
|
|
|
ErrorOr<ByteBuffer> encode_pem(ReadonlyBytes, PEMType = PEMType::Certificate);
|
2020-04-08 22:09:48 +00:00
|
|
|
|
|
|
|
}
|