All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.config.model.api.EndpointCertificateSecretStore Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.config.model.api;

import java.util.Optional;

/**
 * @author tokle
 */
public interface EndpointCertificateSecretStore {

    default EndpointCertificateSecrets getSecret(EndpointCertificateMetadata metadata) {
        Optional certificate = getCertificate(metadata);
        Optional key = getPrivateKey(metadata);
        if (certificate.isPresent() && key.isPresent()) {
            return new EndpointCertificateSecrets(certificate.get(), key.get(), metadata.version());
        } else {
            return EndpointCertificateSecrets.missing(metadata.version());
        }
    }

    Optional getPrivateKey(EndpointCertificateMetadata metadata);
    Optional getCertificate(EndpointCertificateMetadata metadata);

    boolean supports(EndpointCertificateMetadata.Provider provider);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy