@Test
    void verifySecretKeys() throws Throwable {
        val factory = new BasicResourceCredentialFactoryBean();
        factory.setUsageType("UNSPECIFIED");
        factory.setSecretKeyInfo(new ClassPathResource("keys/secret.key"));
        factory.setSecretKeyAlgorithm("RSA");

        factory.setSecretKeyEncoding(BasicResourceCredentialFactoryBean.SecretKeyEncoding.BINARY);
        assertNotNull(factory.getObject());

        factory.setSecretKeyEncoding(BasicResourceCredentialFactoryBean.SecretKeyEncoding.HEX);
        assertThrows(BeanCreationException.class, factory::getObject);

        factory.setSecretKeyEncoding(BasicResourceCredentialFactoryBean.SecretKeyEncoding.BASE64);
        assertNotNull(factory.getObject());
    }
This is {@link BasicResourceCredentialFactoryBeanTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-saml-core/src/test/java/org/apereo/cas/support/saml/util/credential/BasicResourceCredentialFactoryBeanTests.java