Examples of XKMSException


Examples of org.wso2.xkms2.XKMSException

                        aliases.add(alias);
                    }
                }
            }
        } catch (KeyStoreException e) {
            throw new XKMSException(e);
        }
        return aliases;
    }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

                } else {
                    certFact = CertificateFactory
                            .getInstance("X.509", provider);
                }
            } catch (CertificateException e) {
                throw new XKMSException("unsupportedCertType");

            } catch (NoSuchProviderException e) {
                throw new XKMSException("noSecProvider");
            }
        }

        return certFact;
    }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

            } else {
                validator = CertPathValidator.getInstance("PKIX", provider);
            }
            validator.validate(path, param);
        } catch (java.security.NoSuchProviderException e) {
            throw new XKMSException("certpath");
        } catch (java.security.NoSuchAlgorithmException e) {
            throw new XKMSException("certpath");
        } catch (java.security.cert.CertificateException e) {
            throw new XKMSException("certpath");
        } catch (java.security.InvalidAlgorithmParameterException e) {
            throw new XKMSException("certpath");
        } catch (java.security.cert.CertPathValidatorException e) {
            throw new XKMSException("certpath");
        } catch (java.security.KeyStoreException e) {
            throw new XKMSException("certpath");
        }

        return true;
    }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

            } else {
                return (X509Certificate) certs[0];

            }
        } catch (KeyStoreException e) {
            throw new XKMSException("keystore");
        }
    }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

            } else if (certs == null) {
                // At this pont we don't have certs or a cert
                return null;
            }
        } catch (KeyStoreException e) {
            throw new XKMSException("keystore");
        }

        X509Certificate[] x509certs = new X509Certificate[certs.length];
        for (int i = 0; i < certs.length; i++) {
            x509certs[i] = (X509Certificate) certs[i];
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

            certs = getCertificates(alias);

            // If no certificates have been found, there has to be an error:
            // The keystore can find an alias but no certificate(s)
            if (certs == null | certs.length < 1) {
                throw new XKMSException("noCertForAlias");
            }

            // Form a certificate chain from the transmitted certificate
            // and the certificate(s) of the issuer from the keystore
            // First, create new array
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

                if (Arrays.equals(data, skiBytes)) {
                    return alias;
                }
            }
        } catch (KeyStoreException e) {
            throw new XKMSException(e);
        }
        return null;
    }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

        byte[] derEncodedValue = cert.getExtensionValue(SKI_OID);

        if (cert.getVersion() < 3 || derEncodedValue == null) {
            PublicKey key = cert.getPublicKey();
            if (!(key instanceof RSAPublicKey)) {
                throw new XKMSException("noSKIHandling");
            }
            byte[] encoded = key.getEncoded();
            // remove 22-byte algorithm ID and header
            byte[] value = new byte[encoded.length - 22];
            System.arraycopy(encoded, 22, value, 0, value.length);
            MessageDigest sha;
            try {
                sha = MessageDigest.getInstance("SHA-1");
            } catch (NoSuchAlgorithmException ex) {
                throw new XKMSException("noSKIHandling");
            }
            sha.reset();
            sha.update(value);
            return sha.digest();
        }
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

        SOAPEnvelope env = msgCtx.getEnvelope();
        OMElement llomElement = env.getBody().getFirstElement();

        if (llomElement == null) {
            throw new XKMSException(XKMSException.INCOMPLETE, "RequiredDataMissing");   
        }

        XKMSUtil.DOOMElementMetadata doomMetadata = XKMSUtil
                .getDOOMElement(llomElement);
        OMElement xkmsElement = doomMetadata.getElement();
View Full Code Here

Examples of org.wso2.xkms2.XKMSException

        super.buildElement(element, reissueRequest);

        OMElement reissueKeyBindingElement = element
                .getFirstChildWithName(XKMS2Constants.Q_ELEM_REISSUE_KEY_BINDING);
        if (reissueKeyBindingElement == null) {
            throw new XKMSException("ReissueKeyBinding element not found");
        }

        reissueRequest
                .setReissueKeyBinding((ReissueKeyBinding) ReissueKeyBindingBuilder.INSTANCE
                        .buildElement(reissueKeyBindingElement));

        OMElement proofOfPossessionElem = element
                .getFirstChildWithName(XKMS2Constants.Q_ELEM_PROOF_OF_POSSESSION);
        if (proofOfPossessionElem != null) {
            OMElement xmlSigElem = proofOfPossessionElem
                    .getFirstChildWithName(XKMS2Constants.Q_ELEM_XML_SIG);
            XMLSignature signature;
            try {
                signature = new XMLSignature((Element) xmlSigElem, "");
                reissueRequest.setProofOfPocession(signature);

            } catch (XMLSignatureException e) {
                throw new XKMSException(e);

            } catch (XMLSecurityException e) {
                throw new XKMSException(e);
            }
        }

        return reissueRequest;
    }
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.