rhtyd commented on a change in pull request #2239: CLOUDSTACK-9993: Securing Agents Communications URL: https://github.com/apache/cloudstack/pull/2239#discussion_r134773048
########## File path: framework/ca/src/org/apache/cloudstack/framework/ca/CAProvider.java ########## @@ -0,0 +1,93 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.cloudstack.framework.ca; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.GeneralSecurityException; +import java.security.cert.X509Certificate; +import java.util.List; +import java.util.Map; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; + +public interface CAProvider { + + /** + * Method returns capability of the plugin to participate in certificate issuance, revocation and provisioning + * @return + */ + boolean canProvisionCertificates(); + + /** + * Returns root CA certificate + * @return returns concatenated root CA certificate string + */ + List<X509Certificate> getCaCertificate(); + + /** + * Issues certificate with provided options + * @param domainNames + * @param ipAddresses + * @param validityDays + * @return + */ + Certificate issueCertificate(final List<String> domainNames, final List<String> ipAddresses, final int validityDays); + + /** + * Issues certificate using given CSR and other options + * @param csr + * @param domainNames + * @param ipAddresses + * @param validityDays + * @return + */ + Certificate issueCertificate(final String csr, final List<String> domainNames, final List<String> ipAddresses, final int validityDays); Review comment: The CSR may or may-not, for systemvm/kvm agents the CSR generated may not know additional names, ips (such as storage, public, link-local, private) etc that CloudStack knows so during certificate generation we use primary domain name from CSR only, and additional details is provided by CloudStack. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
