Java 8 InvalidKeyException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidKeyException class.

This code example shows how to use the following methods:
            return new ECPrivateKeyParameters( 
                            k.getD(),
                            new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
        } 
                         
        throw new InvalidKeyException("can't identify EC private key.");
    } 
 
    public static DERObjectIdentifier getNamedCurveOid( 
        String name)
    { 
        DERObjectIdentifier oid = X962NamedCurves.getOID(name);
         
        if (oid == null)
        { 
            oid = SECNamedCurves.getOID(name);
            if (oid == null)
            { 
                oid = NISTNamedCurves.getOID(name);
            } 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
param = DSAUtil.generatePublicKeyParameter(publicKey);
                } 
                else 
                { 
                    throw new InvalidKeyException("can't recognise key type in DSA based signer");
                } 
            } 
            catch (Exception e)
            { 
                throw new InvalidKeyException("can't recognise key type in DSA based signer");
            } 
        } 
 
        digest.reset();
        signer.init(false, param);
    } 
 
    protected void engineInitSign( 
        PrivateKey      privateKey,
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
param = ECUtil.generatePublicKeyParameter(publicKey);
                } 
                else 
                { 
                    throw new InvalidKeyException("can't recognise key type in ECDSA based signer");
                } 
            } 
            catch (Exception e)
            { 
                throw new InvalidKeyException("can't recognise key type in ECDSA based signer");
            } 
        } 
 
        digest.reset(); 
        signer.init(false, param);
    } 
 
    protected void engineInitSign( 
        PrivateKey privateKey,
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
        } 
 
        try { 
            keyAgreement.init(encryptKey);
        } catch (InvalidKeyException e) {
            Assert.fail(e.getMessage());
        } 
        try { 
            keyAgreement.doPhase(decryptKey, true);
        } catch (InvalidKeyException e) {
            Assert.fail(e.getMessage());
        } catch (IllegalStateException e) {
            Assert.fail(e.getMessage());
        } 
        Assert.assertNotNull("generated secret is null", keyAgreement
                .generateSecret());
 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    throws IllegalBlockSizeException, java.security.InvalidKeyException 
    { 
        byte[] encoded = key.getEncoded();
        if (encoded == null)
        { 
            throw new InvalidKeyException("Cannot wrap key, null encoding.");
        } 
 
        try 
        { 
            if (wrapEngine == null)
            { 
                return engineDoFinal(encoded, 0, encoded.length);
            } 
            else 
            { 
                return wrapEngine.wrap(encoded, 0, encoded.length);
            } 
        } 
        catch (BadPaddingException e)
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            try { 
                return engineGeneratePrivate(new RSAPrivateCrtKeySpec(modulus, publicExponent,
                        privateExponent, primeP, primeQ, primeExponentP, primeExponentQ,
                        crtCoefficient));
            } catch (InvalidKeySpecException e) {
                throw new InvalidKeyException(e);
            } 
        } else if (key instanceof RSAPrivateKey) {
            RSAPrivateKey rsaKey = (RSAPrivateKey) key;
            BigInteger modulus = rsaKey.getModulus();
            BigInteger privateExponent = rsaKey.getPrivateExponent();
 
            try { 
                return engineGeneratePrivate(new RSAPrivateKeySpec(modulus, privateExponent));
            } catch (InvalidKeySpecException e) {
                throw new InvalidKeyException(e);
            } 
        } else { 
            throw new InvalidKeyException(
                    "Key must be RSAPublicKey or RSAPrivateCrtKey or RSAPrivateKey"); 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
        { 
            throw new PGPException("IV invalid: " + e.getMessage(), e);
        } 
        catch (InvalidKeyException e)
        { 
            throw new PGPException("key invalid: " + e.getMessage(), e);
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            return new ECPrivateKeyParameters( 
                            k.getD(),
                            new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
        } 
                         
        throw new InvalidKeyException("can't identify EC private key.");
    } 
 
    public static DERObjectIdentifier getNamedCurveOid( 
        String name)
    { 
        DERObjectIdentifier oid = X962NamedCurves.getOID(name);
         
        if (oid == null)
        { 
            oid = SECNamedCurves.getOID(name);
            if (oid == null)
            { 
                oid = NISTNamedCurves.getOID(name);
            } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
 
            return new JceGenericKey(encryptedKeyAlgorithm, sKey);
        } 
        catch (InvalidKeyException e)
        { 
            throw new OperatorException("key invalid: " + e.getMessage(), e);
        } 
        catch (IllegalBlockSizeException e)
        { 
            throw new OperatorException("illegal blocksize: " + e.getMessage(), e);
        } 
        catch (BadPaddingException e)
        { 
            throw new OperatorException("bad padding: " + e.getMessage(), e);
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
                    primeQ == null ? null : primeQ.toByteArray(),
                    primeExponentP == null ? null : primeExponentP.toByteArray(),
                    primeExponentQ == null ? null : primeExponentQ.toByteArray(),
                    crtCoefficient == null ? null : crtCoefficient.toByteArray()));
        } catch (Exception e) {
            throw new InvalidKeyException(e);
        } 
    } 
 
    @Override 
    synchronized void readParams(byte[][] params) {
        super.readParams(params);
        // params[0] read in super.readParams 
        if (params[1] != null) {
            publicExponent = new BigInteger(params[1]);
        } 
        // params[2] read in super.readParams 
        if (params[3] != null) {
            primeP = new BigInteger(params[3]);
        } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Java 8 InvalidKeyException Questions & Answers:

See Code Examples for Java 8 InvalidKeyException Methods: