1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2020-2021 NOKIA
5 How to use functionality
6 =========================
7 Common information how to use CMPv2 certificate provider described below
10 ------------------------------
12 CMPv2 certificate provider is a part of certificate distribution infrastructure in ONAP.
13 The main functionality of the provider is to forward Certificate Signing Requests (CSRs) created by cert-mananger (https://cert-manager.io) to CertServiceAPI.
15 Additional information can be found on a dedicated page: https://wiki.onap.org/display/DW/CertService+and+K8s+Cert-Manager+integration.
17 By default CMPv2 provider is enabled.
20 ------------------------------
22 In order to be able to request a certificate via CMPv2 provider a *CMPv2Issuer* CRD (Customer Resource Definition) instance has to be created.
24 It is important to note that the attribute *kind* has to be set to **CMPv2Issuer**, all other attributes can be set as needed.
26 **NOTE: a default instance of CMPv2Issuer is created when installing ONAP via OOM deployment.**
28 Here is a definition of a *CMPv2Issuer* provided with ONAP installation:
32 apiVersion: certmanager.onap.org/v1
35 name: cmpv2-issuer-onap
38 url: https://oom-cert-service:8443
39 healthEndpoint: actuator/health
40 certEndpoint: v1/certificate
43 name: cmpv2-issuer-secret
44 certRef: cmpv2Issuer-cert.pem
45 keyRef: cmpv2Issuer-key.pem
50 ------------------------------
52 In order to request a certificate a K8s *Certificate* CRD (Custom Resource Definition) has to be created.
54 It is important that in the section issuerRef following attributes have those values:
56 - group: certmanager.onap.org
60 After *Certificate* CRD has been placed cert manager will send a *CSR* (Certificate Sign Request) to CA (Certificate Authority) via CMPv2 provider.
61 Signed certificate as well as trust anchor (CA root certificate) will be stored in the K8s *secret* specified in *Certificate* CRD (see secretName attribute).
63 By default certificates will be stored in PEM format. It is possible to get certificates also in JKS and P12 format - see example below - more information can be found on official cert manager page.
65 The following SANs types are supported: DNS names, IPs, URIs, emails.
67 Here is an example of a *Certificate*:
71 apiVersion: cert-manager.io/v1
74 name: certificate_name
77 # The secret name to store the signed certificate
78 secretName: secret_name
80 commonName: certissuer.onap.org
99 - onap://cluster.local/
102 # The reference to the CMPv2 issuer
104 group: certmanager.onap.org
106 name: cmpv2-issuer-onap
107 # Section keystores is optional and defines in which format certificates will be stored
108 # If this section is omitted than only PEM format will be present in the secret
112 passwordSecretRef: # Password used to encrypt the keystore
113 name: certservice-key
117 passwordSecretRef: # Password used to encrypt the keystore
118 name: certservice-key
122 Here is an example of generated *secret* containing certificates:
129 Annotations: cert-manager.io/alt-names: localhost,certissuer.onap.org
130 cert-manager.io/certificate-name: certificate_name
131 cert-manager.io/common-name: certissuer.onap.org
132 cert-manager.io/ip-sans:
133 cert-manager.io/issuer-group: certmanager.onap.org
134 cert-manager.io/issuer-kind: CMPv2Issuer
135 cert-manager.io/issuer-name: cmpv2-issuer-onap
136 cert-manager.io/uri-sans:
138 Type: kubernetes.io/tls
142 tls.crt: 1675 bytes <-- Certificate (PEM)
143 tls.key: 1679 bytes <-- Private Key (PEM)
144 truststore.jks: 1265 bytes <-- Trusted anchors (JKS)
145 ca.crt: 1692 bytes <-- Trusted anchors (PEM)
146 keystore.jks: 3786 bytes <-- Certificate and Private Key (JKS)
147 keystore.p12: 4047 bytes <-- Certificate and Private Key (P12)