NPKICreateOrganizationalCA
Creates the Organizational (that is, Tree) Certificate Authority (CA) if one does not already exist (formerly NWPKICreateOrganizationalCA).
#include "npki.h"
NWRCODE NPKICreateOrganizationalCA(
const NPKIContext context,
const unicode *serverDN,
const unicode *organizationalCAName,
const nuint32 keyType,
const nuint32 keySize,
const unicode *subjectDN,
const nuint32 signatureAlgorithm,
const nuint32 dateFlags,
const nuint32 validFrom,
const nuint32 validTo,
const nuint32 publicKeyFlags,
const nuint32 privateKeyFlags,
const NPKI_Extension *keyUsage,
const NPKI_Extension *basicConstraints,
const NPKI_ExtAltNames *altNames,
const NPKI_Extension *NovellAttr,
const NPKI_ASN1_Extensions *extensions,
unicode const **organizationalCADN,
const nuint32 retryFlag,
void *reserved1,
void *reserved2);
You can call NPKIGetServerInfo to determine the validity period supported by the server.
NOTE:There currently is one Optional Private Key Flag (PRIVATE_KEY _EXTRACTABLE). To use this optional flag, it must be ORed with the value PRIVATE_KEY to enable extraction of the CA’s private key into a PKCS #12 file. (PKCS #12 is the standard format for extracting and importing keys). This flag must be used to enable backup of the CA’s private key.
For a sample implementation of this task, see BackupCA.
When using the PRIVATE_KEY_EXTRACTABLE flag and including the Novell Security Attributes™ extension, it is necessary to bitwise-OR the extractable option (that is, NOVELL_EXTENSION_EXTRACTABLE_KEY in Additional Flags) along with the appropriate Novell attribute (see NOVELL_EXTENSION_ORGCA_DEFAULT (0x00400) in Mutually Exclusive Flags) to the flags field in the Novell Security Attributes extension.
Because of the possibility of replication delay, subsequent calls to NPKICreateOrganizationalCA might be necessary (for example, if previous calls fail due to replication delay); however, subsequent calls should be made with the retryFlag set to PKI_RETRY so that the system does not try to create a new CA object. The error code that is usually associated with a replication delay is ERR_NO_SUCH_ENTRY, -601.
Returns 0 if successful, or an eDirectory, NICI, or PKI error code if not successful.
0x 2222 92 02 Install CA
NPKICreateOrganizationalCA creates a Certificate Authority (CA) object in the Security container if one does not exist.
This function gives serverDN supervisor (S) rights to the All_Attributes ACL of the CA object, sets the NDSPKI:Organizational CA DN attribute of the Security container to be the distinguished name of the CA object, and gives [Public] read (R) rights to the NDSPKI:Organizational CA DN attribute of the Security container.
This function makes the Install CA NCP call to serverDN. This causes PKI services to generate an RSA key pair, create two X.509 certificates (one self-signed and one signed by the server’s machine unique key), and store all of this information in the CA object.
To have the ability to backup the CA’s private key, you must use the optional private key flag, PRIVATE_KEY_EXTRACTABLE.
For a sample implementation of how to back up the CA, see BackupCA.