mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Add LMS/HSS public key DER encoding
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
|
||||
* Copyright 2014-2025 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
@@ -173,6 +173,8 @@ enum {
|
||||
OID_cms_signed_and_enveloped_data,
|
||||
OID_cms_encrypted_data,
|
||||
OID_cms_key_agreement_info,
|
||||
|
||||
OID_hss_lms_hashsig, // LMS/HSS public key
|
||||
};
|
||||
|
||||
// {iso(1) org(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
|
||||
|
||||
@@ -279,18 +279,13 @@ int sm3_hss_verify_update(SM3_HSS_SIGN_CTX *ctx, const uint8_t *data, size_t dat
|
||||
int sm3_hss_verify_finish(SM3_HSS_SIGN_CTX *ctx);
|
||||
|
||||
|
||||
/*
|
||||
from RFC 9708
|
||||
|
||||
id-alg-hss-lms-hashsig OBJECT IDENTIFIER ::= {
|
||||
iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
|
||||
pkcs-9(9) smime(16) alg(3) 17
|
||||
}
|
||||
*/
|
||||
#include <gmssl/oid.h>
|
||||
|
||||
#define oid_hss_lms_hashsig oid_pkcs,9,16,3,17
|
||||
|
||||
// X.509 related
|
||||
int sm3_hss_public_key_to_der(const SM3_HSS_KEY *key, uint8_t **out, size_t *outlen);
|
||||
int sm3_hss_public_key_from_der(SM3_HSS_KEY *key, const uint8_t **in, size_t *inlen);
|
||||
int sm3_hss_public_key_algor_to_der(uint8_t **out, size_t *outlen);
|
||||
int sm3_hss_public_key_algor_from_der(const uint8_t **in, size_t *inlen);
|
||||
int sm3_hss_public_key_info_to_der(const SM3_HSS_KEY *key, uint8_t **out, size_t *outlen);
|
||||
int sm3_hss_public_key_info_from_der(SM3_HSS_KEY *key, const uint8_t **in, size_t *inlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user