Class ElytronUtil
- java.lang.Object
-
- org.jboss.as.cli.impl.aesh.cmd.security.model.ElytronUtil
-
public abstract class ElytronUtil extends Object
Utility class to interact with Elytron subsystem.- Author:
- jdenise@redhat.com
-
-
Field Summary
Fields Modifier and Type Field Description static StringHTTP_SERVER_CAPABILITYstatic StringJKSstatic StringOOTB_APPLICATION_DOMAINstatic StringOOTB_APPLICATION_HTTP_FACTORYstatic StringOOTB_MANAGEMENT_HTTP_FACTORYstatic StringOOTB_MANAGEMENT_SASL_FACTORYstatic StringPKCS12static StringSASL_SERVER_CAPABILITYstatic StringTLS_V1_2
-
Method Summary
-
-
-
Field Detail
-
JKS
public static final String JKS
- See Also:
- Constant Field Values
-
PKCS12
public static final String PKCS12
- See Also:
- Constant Field Values
-
TLS_V1_2
public static final String TLS_V1_2
- See Also:
- Constant Field Values
-
OOTB_MANAGEMENT_SASL_FACTORY
public static String OOTB_MANAGEMENT_SASL_FACTORY
-
OOTB_MANAGEMENT_HTTP_FACTORY
public static String OOTB_MANAGEMENT_HTTP_FACTORY
-
OOTB_APPLICATION_HTTP_FACTORY
public static String OOTB_APPLICATION_HTTP_FACTORY
-
OOTB_APPLICATION_DOMAIN
public static String OOTB_APPLICATION_DOMAIN
-
SASL_SERVER_CAPABILITY
public static final String SASL_SERVER_CAPABILITY
- See Also:
- Constant Field Values
-
HTTP_SERVER_CAPABILITY
public static final String HTTP_SERVER_CAPABILITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
trustManagerExists
public static boolean trustManagerExists(CommandContext ctx, String name) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
keyStoreExists
public static boolean keyStoreExists(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
serverSSLContextExists
public static boolean serverSSLContextExists(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
getKeyStoreNames
public static List<String> getKeyStoreNames(ModelControllerClient client)
-
getSecurityDomainNames
public static List<String> getSecurityDomainNames(ModelControllerClient client)
-
getConstantRoleMappers
public static List<String> getConstantRoleMappers(ModelControllerClient client)
-
hasServerSSLContext
public static boolean hasServerSSLContext(CommandContext context, String sslContextName)
-
getServerSSLContext
public static ServerSSLContext getServerSSLContext(CommandContext context, String sslContextName)
-
getKeyStore
public static KeyStore getKeyStore(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
isElytronSupported
public static boolean isElytronSupported(CommandContext commandContext) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
isKeyStoreManagementSupported
public static boolean isKeyStoreManagementSupported(CommandContext commandContext) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
getAuthFactoryResource
public static org.jboss.dmr.ModelNode getAuthFactoryResource(String authFactory, AuthFactorySpec spec, CommandContext ctx)
-
reorderSASLFactory
public static org.jboss.dmr.ModelNode reorderSASLFactory(CommandContext ctx, List<String> order, String factoryName) throws Exception
- Throws:
Exception
-
findMatchingAuthFactory
public static AuthFactory findMatchingAuthFactory(AuthMechanism newMechanism, AuthFactorySpec spec, CommandContext ctx) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
getAuthFactory
public static AuthFactory getAuthFactory(String authFactory, AuthFactorySpec spec, CommandContext ctx)
-
getAuthFactory
public static AuthFactory getAuthFactory(org.jboss.dmr.ModelNode mn, String authFactory, AuthFactorySpec spec, CommandContext ctx)
-
findMatchingUsersPropertiesRealm
public static String findMatchingUsersPropertiesRealm(CommandContext ctx, PropertiesRealmConfiguration config) throws Exception
- Throws:
Exception
-
serverPropertiesRealmExists
public static boolean serverPropertiesRealmExists(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
addUsersPropertiesRealm
public static org.jboss.dmr.ModelNode addUsersPropertiesRealm(CommandContext ctx, String realmName, PropertiesRealmConfiguration config) throws Exception
- Throws:
Exception
-
findKeyStoreRealm
public static String findKeyStoreRealm(CommandContext ctx, String trustStore) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
addKeyStoreRealm
public static org.jboss.dmr.ModelNode addKeyStoreRealm(CommandContext ctx, String ksRealmName, String keyStore) throws OperationFormatException
- Throws:
OperationFormatException
-
findConstantRealmMapper
public static String findConstantRealmMapper(CommandContext ctx, String realmName) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
addConstantRealmMapper
public static org.jboss.dmr.ModelNode addConstantRealmMapper(CommandContext ctx, String realmName) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
securityDomainExists
public static boolean securityDomainExists(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
addSecurityDomain
public static org.jboss.dmr.ModelNode addSecurityDomain(CommandContext ctx, Realm realm, String newSecurityDomain) throws OperationFormatException
- Throws:
OperationFormatException
-
factoryExists
public static boolean factoryExists(CommandContext ctx, String name, AuthFactorySpec spec) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
addAuthFactory
public static org.jboss.dmr.ModelNode addAuthFactory(CommandContext ctx, SecurityDomain securityDomain, String newAuthFactoryName, AuthFactorySpec spec) throws OperationFormatException
- Throws:
OperationFormatException
-
addAuthMechanism
public static void addAuthMechanism(CommandContext ctx, AuthFactory authFactory, AuthMechanism mechanism, org.jboss.dmr.ModelNode steps) throws OperationFormatException
- Throws:
OperationFormatException
-
addRealm
public static void addRealm(CommandContext ctx, SecurityDomain securityDomain, Realm realm, org.jboss.dmr.ModelNode steps) throws OperationFormatException
- Throws:
OperationFormatException
-
getSecurityDomainResource
public static org.jboss.dmr.ModelNode getSecurityDomainResource(SecurityDomain domain, CommandContext ctx)
-
getMechanisms
public static List<String> getMechanisms(CommandContext ctx, AuthFactorySpec spec) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
getAvailableMechanisms
public static List<String> getAvailableMechanisms(CommandContext ctx, AuthFactorySpec spec) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
getFileSystemRealmNames
public static List<String> getFileSystemRealmNames(ModelControllerClient client)
-
getPropertiesRealmNames
public static List<String> getPropertiesRealmNames(ModelControllerClient client)
-
getKeyStoreRealmNames
public static List<String> getKeyStoreRealmNames(ModelControllerClient client)
-
getSimpleDecoderNames
public static List<String> getSimpleDecoderNames(ModelControllerClient client)
-
localUserExists
public static boolean localUserExists(CommandContext ctx) throws IOException, OperationFormatException
- Throws:
IOExceptionOperationFormatException
-
removeMechanisms
public static org.jboss.dmr.ModelNode removeMechanisms(CommandContext ctx, org.jboss.dmr.ModelNode factory, String factoryName, AuthFactorySpec spec, Set<String> toRemove) throws Exception
- Throws:
Exception
-
getMechanisms
public static List<String> getMechanisms(CommandContext ctx, String factoryName, AuthFactorySpec spec) throws Exception
- Throws:
Exception
-
constantRoleMapperExists
public static boolean constantRoleMapperExists(CommandContext ctx, String name) throws OperationFormatException, IOException
- Throws:
OperationFormatExceptionIOException
-
addCertificateAuthority
public static org.jboss.dmr.ModelNode addCertificateAuthority(org.wildfly.security.x500.cert.acme.CertificateAuthority certificateAuthority) throws Exception- Throws:
Exception
-
addCertificateAuthorityAccount
public static org.jboss.dmr.ModelNode addCertificateAuthorityAccount(String name, String password, String alias, String keyStoreName, List<String> contactUrls, org.wildfly.security.x500.cert.acme.CertificateAuthority customCertificateAuthority) throws Exception
- Throws:
Exception
-
removeCertificateAuthorityAccount
public static org.jboss.dmr.ModelNode removeCertificateAuthorityAccount(String name) throws Exception
- Throws:
Exception
-
obtainCertificateRequest
public static org.jboss.dmr.ModelNode obtainCertificateRequest(String keyStoreName, String alias, String password, List<String> domainNames, String certificateAuthorityAccount, boolean agreedToTOS, int key_size, String key_algorithm) throws Exception
- Throws:
Exception
-
getCaAccountNames
public static List<String> getCaAccountNames(ModelControllerClient client)
-
-