Examples of CryptoService


Examples of dbfit.util.crypto.CryptoService

        checkEncryptedPropertiesLoad(CryptoTestsConfig.getFakeCryptoService());
    }

    @Test
    public void testEncryptedPropertiesLoadWithRealCrypto() throws Exception {
        CryptoService crypto = initTestKeyStore();
        checkEncryptedPropertiesLoad(crypto);
    }
View Full Code Here

Examples of dbfit.util.crypto.CryptoService

    // Integration test with real crypto svc
    @Test
    public void testEncryptedPropertyLoadRealCryptoSvc() throws Exception {
        java.io.File ksRoot = tempKeyStoreFolder.getRoot();
        CryptoTestsConfig.createTestKeyStore(ksRoot);
        CryptoService crypto = CryptoTestsConfig.getCryptoService(ksRoot);

        PropertiesLoader loader = new PropertiesLoader(crypto);

        Map<String, String> props = loader.loadFromList(
            PropertiesTestsSetUp.prepareEncryptedSettings(crypto.encrypt(DB_PASSWORD)));

        assertEquals(DB_PASSWORD, props.get("password"));
    }
View Full Code Here

Examples of io.apigee.trireme.core.internal.CryptoService

        ByteArrayInputStream bis =
            new ByteArrayInputStream(certBuf.getArray(), certBuf.getArrayOffset(),
                                     certBuf.getLength());

        CryptoService crypto = Crypto.getCryptoService();
        try {
            try {
                pubKey = crypto.readPublicKey(self.algorithm.getKeyFormat(), bis);
            } catch (CryptoException ce) {
                // It might not be a key
            }

            if (pubKey == null) {
                bis.reset();
                try {
                    KeyPair pair = crypto.readKeyPair(self.algorithm.getKeyFormat(), bis, null);
                    pubKey = pair.getPublic();
                } catch (CryptoException ce) {
                    // And it might not be a key pair either
                }
            }

            if (pubKey == null) {
                bis.reset();
                cert = crypto.readCertificate(bis);

                if (cert == null) {
                    throw Utils.makeError(cx, thisObj, "no certificates available");
                }
            }
View Full Code Here

Examples of org.apache.fulcrum.crypto.CryptoService

        String algorithm = getConfiguration().getString(
                SecurityService.SECURE_PASSWORDS_ALGORITHM_KEY,
                SecurityService.SECURE_PASSWORDS_ALGORITHM_DEFAULT);

        CryptoService cs = null;
        try {
            ServiceManager serviceManager = TurbineServices.getInstance();
            cs = (CryptoService)serviceManager.getService(CryptoService.ROLE);
        }
        catch (Exception e){
            throw new RuntimeException("Could not access Crypto Service",e);
        }

        if (cs != null && (secure.equals("true") || secure.equals("yes")))
        {
            try
            {
                CryptoAlgorithm ca = cs.getCryptoAlgorithm(algorithm);

                ca.setSeed(salt);

                String result = ca.encrypt(password);
View Full Code Here

Examples of org.apache.fulcrum.crypto.CryptoService

        assertNotNull(avalonComponentService);

        GlobalCacheService dgcs = (GlobalCacheService)avalonComponentService.lookup(GlobalCacheService.ROLE);
        assertNotNull(dgcs);
        CryptoService cs = (CryptoService)avalonComponentService.lookup(CryptoService.ROLE);
        assertNotNull(cs);
        LocalizationService ls = (LocalizationService)avalonComponentService.lookup(LocalizationService.ROLE);
        assertNotNull(ls);
        IntakeService intake = (IntakeService)avalonComponentService.lookup(IntakeService.ROLE);
        assertNotNull(intake);
View Full Code Here

Examples of org.apache.fulcrum.crypto.CryptoService

    {
        ServiceManager serviceManager = TurbineServices.getInstance();

        GlobalCacheService gcs = (GlobalCacheService)serviceManager.getService(GlobalCacheService.ROLE);
        assertNotNull(gcs);
        CryptoService cs = (CryptoService)serviceManager.getService(CryptoService.ROLE);
        assertNotNull(cs);
        LocalizationService ls = (LocalizationService)serviceManager.getService(LocalizationService.ROLE);
        assertNotNull(ls);
        IntakeService intake = (IntakeService)serviceManager.getService(IntakeService.ROLE);
        assertNotNull(intake);
View Full Code Here

Examples of org.apache.hadoop.gateway.services.security.CryptoService

    EasyMock.expect( context.getWebAppDescriptor() ).andReturn( Descriptors.create( WebAppDescriptor.class ) ).anyTimes();
    EasyMock.expect( context.getTopology() ).andReturn( topology ).anyTimes();
    EasyMock.replay( context );

    AliasService as = EasyMock.createNiceMock( AliasService.class );
    CryptoService cryptoService = new DefaultCryptoService();
    ((DefaultCryptoService)cryptoService).setAliasService( as );

    GatewayServices gatewayServices = EasyMock.createNiceMock( GatewayServices.class );
    EasyMock.expect( gatewayServices.getService( GatewayServices.CRYPTO_SERVICE ) ).andReturn( cryptoService ).anyTimes();
View Full Code Here

Examples of org.apache.hadoop.gateway.services.security.CryptoService

  @Test
  public void testSimpleQueryEncoding() throws Exception {
    AliasService as = EasyMock.createNiceMock( AliasService.class );
    String secret = "sdkjfhsdkjfhsdfs";
    EasyMock.expect( as.getPasswordFromAliasForCluster("test-cluster-name", "encryptQueryString")).andReturn( secret.toCharArray() ).anyTimes();
    CryptoService cryptoService = new DefaultCryptoService();
    ((DefaultCryptoService)cryptoService).setAliasService(as);
    GatewayServices gatewayServices = EasyMock.createNiceMock( GatewayServices.class );
    EasyMock.expect( gatewayServices.getService( GatewayServices.CRYPTO_SERVICE ) ).andReturn( cryptoService );

    UrlRewriteEnvironment environment = EasyMock.createNiceMock( UrlRewriteEnvironment.class );
View Full Code Here

Examples of org.apache.hadoop.gateway.services.security.CryptoService

    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();
    EasyMock.expect( context.getTopology() ).andReturn( topology ).anyTimes();
    EasyMock.replay( context );

    AliasService as = EasyMock.createNiceMock( AliasService.class );
    CryptoService cryptoService = new DefaultCryptoService();
    ((DefaultCryptoService)cryptoService).setAliasService(as);

    GatewayServices gatewayServices = EasyMock.createNiceMock( GatewayServices.class );
    EasyMock.expect( gatewayServices.getService( GatewayServices.CRYPTO_SERVICE ) ).andReturn( cryptoService ).anyTimes();
View Full Code Here

Examples of org.apache.hadoop.gateway.services.security.CryptoService

    // Test encryption.  Results are left in encTemplate

    AliasService as = EasyMock.createNiceMock( AliasService.class );
    String secret = "sdkjfhsdkjfhsdfs";
    EasyMock.expect( as.getPasswordFromAliasForCluster("test-cluster-name", "encryptQueryString")).andReturn( secret.toCharArray() ).anyTimes();
    CryptoService cryptoService = new DefaultCryptoService();
    ((DefaultCryptoService)cryptoService).setAliasService(as);
    GatewayServices gatewayServices = EasyMock.createNiceMock( GatewayServices.class );
    EasyMock.expect( gatewayServices.getService( GatewayServices.CRYPTO_SERVICE ) ).andReturn( cryptoService );

    UrlRewriteEnvironment encEnvironment = EasyMock.createNiceMock( UrlRewriteEnvironment.class );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.