Package org.jose4j.lang

Examples of org.jose4j.lang.JoseException


            {
                return new OctetSequenceJsonWebKey(params);
            }
            else
            {
                throw new JoseException("Unknown key algorithm: '" + kty + "'");
            }
        }
View Full Code Here


            {
                return new EllipticCurveJsonWebKey((ECPublicKey)key);
            }
            else if (PublicKey.class.isInstance(key))
            {
                throw new JoseException("Unsupported or unknown public key " + key);
            }
            else
            {
                return new OctetSequenceJsonWebKey(key);
            }
View Full Code Here

        {
            derEncodedSignatureBytes = convertConcatenatedToDer(signatureBytes);
        }
        catch (IOException e)
        {
            throw new JoseException("Unable to convert R and S as a concatenated byte array to DER encoding.", e);
        }

        return super.verifySignature(derEncodedSignatureBytes, key, securedInputBytes);
    }
View Full Code Here

        {
            return convertDerToConcatenated(derEncodedSignatureBytes, signatureByteLength);
        }
        catch (IOException e)
        {
            throw new JoseException("Unable to convert DER encoding to R and S as a concatenated byte array.", e);
        }
    }
View Full Code Here

        {
            return KeyFactory.getInstance(getAlgorithm());
        }
        catch (NoSuchAlgorithmException e)
        {
            throw new JoseException("Couldn't find " + getAlgorithm() + " KeyFactory! " + e, e);
        }
    }
View Full Code Here

        {
            return KeyPairGenerator.getInstance(getAlgorithm());
        }
        catch (NoSuchAlgorithmException e)
        {
            throw new JoseException("Couldn't find " + getAlgorithm() + " KeyPairGenerator! " + e, e);
        }
    }
View Full Code Here

            PublicKey publicKey = getKeyFactory().generatePublic(rsaPublicKeySpec);
            return (RSAPublicKey) publicKey;
        }
        catch (InvalidKeySpecException e)
        {
            throw new JoseException("Invalid key spec: " + e, e);
        }
    }
View Full Code Here

            PrivateKey privateKey = getKeyFactory().generatePrivate(keySpec);
            return (RSAPrivateKey) privateKey;
        }
        catch (InvalidKeySpecException e)
        {
            throw new JoseException("Invalid key spec: " + e, e);
        }
    }
View Full Code Here

            cipher.init(mode, key, parameterSpec);
            return cipher;
        }
        catch (java.security.InvalidKeyException e)
        {
            throw new JoseException("Invalid key for " + algorithm, e);
        }
        catch (InvalidAlgorithmParameterException e)
        {
            throw new JoseException(e.toString(), e);
        }
    }
View Full Code Here

        {
            cipherOutput = cipher.doFinal(plaintext);
        }
        catch (IllegalBlockSizeException | BadPaddingException e)
        {
            throw new JoseException(e.toString(), e);
        }

        CipherOutput result = new CipherOutput();
        int tagIndex = cipherOutput.length - tagByteLength;
        result.ciphertext = ByteUtil.subArray(cipherOutput, 0, tagIndex);
View Full Code Here

TOP

Related Classes of org.jose4j.lang.JoseException

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.