Package org.switchyard.security.credential

Examples of org.switchyard.security.credential.CertificateCredential


        }
    }

    @Test
    public void testBinarySecurityToken() throws Exception {
        CertificateCredential cred = getBinarySecurityTokenCertificateCredential();
        if (cred == null) {
            Assert.fail("certificate not found");
        }
        Certificate certificate = ((CertificateCredential)cred).getCertificate();
        Assert.assertEquals("X.509", certificate.getType());
View Full Code Here


    public Set<Credential> extract(SSLSession source) {
        Set<Credential> credentials = new HashSet<Credential>();
        try {
            credentials.add(new ConfidentialityCredential(source.isValid()));
            credentials.add(new PrincipalCredential(source.getPeerPrincipal()));
            credentials.add(new CertificateCredential(source.getPeerCertificates()[0]));
        } catch (SSLPeerUnverifiedException e) {
            throw BaseSecurityMessages.MESSAGES.unableToExtractCredentials(e.getMessage(), e);
        }
        return credentials;
    }
View Full Code Here

                                    CertificateFactory factory = CertificateFactory.getInstance(certificateMatch(valueType));
                                    InputStream certStream = new ByteArrayInputStream(certBytes);
                                    if (X509PKIPATHV1.equals(valueType)) {
                                        CertPath path = factory.generateCertPath(certStream);
                                        for (Certificate certificate : path.getCertificates()) {
                                            credentials.add(new CertificateCredential(certificate));
                                        }
                                    } else if (X509V3.equals(valueType)) {
                                        Certificate certificate = factory.generateCertificate(certStream);
                                        credentials.add(new CertificateCredential(certificate));
                                    } else if (PKCS7.equals(valueType)) {
                                        throw BaseSecurityMessages.MESSAGES.valueTypeRecognizedNotImplemented(valueType);
                                    } else {
                                        throw BaseSecurityMessages.MESSAGES.valueTypeNotImplemented(valueType);
                                    }
View Full Code Here

TOP

Related Classes of org.switchyard.security.credential.CertificateCredential

Copyright © 2018 www.massapicom. 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.