1 =pod 2 3 =head1 NAME 4 5 X509_get0_distinguishing_id, X509_set0_distinguishing_id, 6 X509_REQ_get0_distinguishing_id, X509_REQ_set0_distinguishing_id 7 - get or set the Distinguishing ID for certificate operations 8 9 =head1 SYNOPSIS 10 11 #include <openssl/x509.h> 12 13 ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x); 14 void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *distid); 15 ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x); 16 void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *distid); 17 18 =head1 DESCRIPTION 19 20 The Distinguishing ID is defined in FIPS 196 as follows: 21 22 =over 4 23 24 =item I<Distinguishing identifier> 25 26 Information which unambiguously distinguishes 27 an entity in the authentication process. 28 29 =back 30 31 The SM2 signature algorithm requires a Distinguishing ID value when generating 32 and verifying a signature, but the Ddistinguishing ID may also find other uses. 33 In the context of SM2, the Distinguishing ID is often referred to as the "SM2 34 ID". 35 36 For the purpose off verifying a certificate or a certification request, a 37 Distinguishing ID may be attached to it, so functions like L<X509_verify(3)> 38 or L<X509_REQ_verify(3)> have easy access to that identity for signature 39 verification. 40 41 X509_get0_distinguishing_id() gets the Distinguishing ID value of a certificate 42 B<x> by returning an B<ASN1_OCTET_STRING> object which should not be freed by 43 the caller. 44 45 X509_set0_distinguishing_id() assigns B<distid> to the certificate B<x>. 46 Calling this function transfers the memory management of the value to the X509 47 object, and therefore the value that has been passed in should not be freed by 48 the caller after this function has been called. 49 50 X509_REQ_get0_distinguishing_id() and X509_REQ_set0_distinguishing_id() 51 have the same functionality as X509_get0_distinguishing_id() and 52 X509_set0_distinguishing_id() except that they deal with B<X509_REQ> 53 objects instead of B<X509>. 54 55 =head1 RETURN VALUES 56 57 X509_set0_distinguishing_id() and X509_REQ_set0_distinguishing_id() do not 58 return a value. 59 60 =head1 SEE ALSO 61 62 L<X509_verify(3)>, L<SM2(7)> 63 64 =head1 COPYRIGHT 65 66 Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. 67 68 Licensed under the Apache License 2.0 (the "License"). You may not use 69 this file except in compliance with the License. You can obtain a copy 70 in the file LICENSE in the source distribution or at 71 L<https://www.openssl.org/source/license.html>. 72 73 =cut 74