2 * Copyright (c) 2015 Inocybe Technologies. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.aaa.cert.api;
11 import java.security.KeyStore;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.CtlKeystore;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.TrustKeystore;
17 * IAaaCertProvider defines the basic operation for certificates management
22 public interface IAaaCertProvider {
25 * Add certificate to ODL keystore, the certificate should be signed by a CA (Certificate Authority) based on a certificate
26 * request generated by the ODL keystore.
28 * @param storePasswd ODL keystore password
29 * @param alias certificate alias
30 * @param certificate certificate @Nonnull String
31 * @return true at successful adding certificate
33 boolean addCertificateODLKeyStore(@Nonnull String storePasswd, @Nonnull String alias, @Nonnull String certificate);
36 * Add certificate to ODL keystore, the certificate should be signed by a CA (Certificate Authority) based on a certificate
37 * request generated by the ODL keystore.
39 * @param alias certificate alias
40 * @param certificate certificate @Nonnull String
41 * @return true at successful adding certificate
43 boolean addCertificateODLKeyStore(@Nonnull String alias, @Nonnull String certificate);
46 * Add certificate to Trust keystore.
48 * @param storePasswd ODL keystore password
49 * @param alias certificate alias
50 * @param certificate certificate @Nonnull String
51 * @return true at successful adding certificate
53 boolean addCertificateTrustStore(@Nonnull String storePasswd, @Nonnull String alias, @Nonnull String certificate);
56 * Add certificate to Trust keystore.
58 * @param alias certificate alias
59 * @param certificate certificate @Nonnull String
60 * @return true if certificate was added successfully
62 boolean addCertificateTrustStore(@Nonnull String alias, @Nonnull String certificate);
65 * Generate certificate request from the ODL keystore to be signed by a CA
67 * @param storePasswd ODL keystore password
68 * @param withTag return the certificate Req string with tag if true
69 * @return the certificate request
71 @Nonnull String genODLKeyStoreCertificateReq(@Nonnull String storePasswd, boolean withTag);
74 * Generate certificate request from the ODL keystore to be signed by a CA
76 * @param withTag return the certificate Req string with tag if true
77 * @return the certificate request
79 @Nonnull String genODLKeyStoreCertificateReq(boolean withTag);
82 * Get certificate from the Trust keystore
84 * @param storePasswd Trust keystore password
85 * @param alias the certificate alias
86 * @param withTag return the certificate string with tag if true
87 * @return the certificate
89 @Nonnull String getCertificateTrustStore(@Nonnull String storePasswd, @Nonnull String alias, boolean withTag);
92 * Get certificate from the Trust keystore
94 * @param alias the certificate alias
95 * @param withTag return certificate string with tag if true
96 * @return the certificate
98 @Nonnull String getCertificateTrustStore(@Nonnull String alias, final boolean withTag);
101 * Get ODL keystore certificate.
103 * @param storePasswd ODL keystore password
104 * @param withTag return certificate string with tag if true
105 * @return the certificate
107 @Nonnull String getODLKeyStoreCertificate(@Nonnull String storePasswd, boolean withTag);
110 * Get ODL keystore certificate
112 * @param withTag return certificate string with tag if true
113 * @return the certificate
115 @Nonnull String getODLKeyStoreCertificate(boolean withTag);
118 * Get ODL Keystore as java keystore object
120 * @return ODL keystore
122 KeyStore getODLKeyStore();
125 * Get Trust Keystore as java keystore object
127 * @return Trust keystore
129 KeyStore getTrustKeyStore();
132 * Get list of of the allowed cipher suites otherwise empty array
134 * @return Cipher suites
136 String[] getCipherSuites();
139 * Get list of the supported TLS protocols
141 * @return TLS protocols
143 String[] getTlsProtocols();
146 * Get the Trust key store Data
148 * @return Trust Keystore Object
150 TrustKeystore getTrustKeyStoreInfo();
153 * Get the ODL key store Data
155 * @return Ctl Keystore Object
157 CtlKeystore getOdlKeyStoreInfo();
160 * Create the ODL and Trust keystores based on the CtlKeystore and TrustKeystore data
162 * @return true if success
164 boolean createKeyStores();