PKCS12_add1_attr_by_NID.pod 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. =pod
  2. =head1 NAME
  3. PKCS12_add1_attr_by_NID, PKCS12_add1_attr_by_txt - Add an attribute to a PKCS#12
  4. safeBag structure
  5. =head1 SYNOPSIS
  6. #include <openssl/pkcs12.h>
  7. int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
  8. const unsigned char *bytes, int len);
  9. int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
  10. const unsigned char *bytes, int len);
  11. =head1 DESCRIPTION
  12. These functions add a PKCS#12 Attribute to the Attribute Set of the B<bag>.
  13. PKCS12_add1_attr_by_NID() adds an attribute of type B<nid> with a value of ASN1
  14. type B<type> constructed using B<len> bytes from B<bytes>.
  15. PKCS12_add1_attr_by_txt() adds an attribute of type B<attrname> with a value of
  16. ASN1 type B<type> constructed using B<len> bytes from B<bytes>.
  17. =head1 NOTES
  18. These functions do not check whether an existing attribute of the same type is
  19. present. There can be multiple attributes with the same type assigned to a
  20. safeBag.
  21. Both functions were added in OpenSSL 3.0.
  22. =head1 RETURN VALUES
  23. A return value of 1 indicates success, 0 indicates failure.
  24. =head1 SEE ALSO
  25. L<PKCS12_create(3)>
  26. =head1 COPYRIGHT
  27. Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  28. Licensed under the Apache License 2.0 (the "License"). You may not use
  29. this file except in compliance with the License. You can obtain a copy
  30. in the file LICENSE in the source distribution or at
  31. L<https://www.openssl.org/source/license.html>.
  32. =cut