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

io.gravitee.apim.common.mapper.KeyStoreMapperImpl Maven / Gradle / Ivy

The newest version!
package io.gravitee.apim.common.mapper;

import io.gravitee.definition.model.v4.ssl.pem.PEMKeyStore;
import io.gravitee.definition.model.v4.ssl.pkcs12.PKCS12KeyStore;
import io.gravitee.node.vertx.client.ssl.jks.JKSKeyStore;
import io.gravitee.node.vertx.client.ssl.none.NoneKeyStore;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-09-13T14:10:48+0000",
    comments = "version: 1.6.0.Beta2, compiler: javac, environment: Java 17.0.8 (Eclipse Adoptium)"
)
public class KeyStoreMapperImpl implements KeyStoreMapper {

    @Override
    public io.gravitee.node.vertx.client.ssl.pem.PEMKeyStore map(PEMKeyStore keystore) {
        if ( keystore == null ) {
            return null;
        }

        io.gravitee.node.vertx.client.ssl.pem.PEMKeyStore.PEMKeyStoreBuilder pEMKeyStore = io.gravitee.node.vertx.client.ssl.pem.PEMKeyStore.builder();

        pEMKeyStore.keyPath( keystore.getKeyPath() );
        pEMKeyStore.keyContent( keystore.getKeyContent() );
        pEMKeyStore.certPath( keystore.getCertPath() );
        pEMKeyStore.certContent( keystore.getCertContent() );

        return pEMKeyStore.build();
    }

    @Override
    public JKSKeyStore map(io.gravitee.definition.model.v4.ssl.jks.JKSKeyStore keystore) {
        if ( keystore == null ) {
            return null;
        }

        JKSKeyStore.JKSKeyStoreBuilder jKSKeyStore = JKSKeyStore.builder();

        jKSKeyStore.path( keystore.getPath() );
        jKSKeyStore.content( keystore.getContent() );
        jKSKeyStore.password( keystore.getPassword() );
        jKSKeyStore.alias( keystore.getAlias() );
        jKSKeyStore.keyPassword( keystore.getKeyPassword() );

        return jKSKeyStore.build();
    }

    @Override
    public io.gravitee.node.vertx.client.ssl.pkcs12.PKCS12KeyStore map(PKCS12KeyStore keystore) {
        if ( keystore == null ) {
            return null;
        }

        io.gravitee.node.vertx.client.ssl.pkcs12.PKCS12KeyStore.PKCS12KeyStoreBuilder pKCS12KeyStore = io.gravitee.node.vertx.client.ssl.pkcs12.PKCS12KeyStore.builder();

        pKCS12KeyStore.path( keystore.getPath() );
        pKCS12KeyStore.content( keystore.getContent() );
        pKCS12KeyStore.password( keystore.getPassword() );
        pKCS12KeyStore.alias( keystore.getAlias() );
        pKCS12KeyStore.keyPassword( keystore.getKeyPassword() );

        return pKCS12KeyStore.build();
    }

    @Override
    public NoneKeyStore map(io.gravitee.definition.model.v4.ssl.none.NoneKeyStore keystore) {
        if ( keystore == null ) {
            return null;
        }

        NoneKeyStore.NoneKeyStoreBuilder noneKeyStore = NoneKeyStore.builder();

        return noneKeyStore.build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy