Java 8 SignatureException - 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 SignatureException class.

This code example shows how to use the following methods:
signature.setParameter(sigParams.getParameterSpec(PSSParameterSpec.class));
                } 
                catch (GeneralSecurityException e)
                { 
                    throw new SignatureException("Exception extracting parameters: " + e.getMessage());
                } 
            } 
        } 
    } 
     
    static String getSignatureName(
        AlgorithmIdentifier sigAlgId) 
    { 
        DEREncodable params = sigAlgId.getParameters();
         
        if (params != null && !derNull.equals(params))
        { 
            // BEGIN android-removed 
            // if (sigAlgId.getObjectId().equals(PKCSObjectIdentifiers.id_RSASSA_PSS)) 
7
CodeRank
This code example shows how to use the following methods:
sig = derDecode(sigBytes);
        } 
        catch (Exception e)
        { 
            throw new SignatureException("error decoding signature bytes.");
        } 
 
        return signer.verifySignature(hash, sig[0], sig[1]);
    } 
 
    protected void engineSetParameter( 
        AlgorithmParameterSpec params)
    { 
        throw new UnsupportedOperationException("engineSetParameter unsupported");
    } 
 
    /** 
     * @deprecated replaced with <a href = "#engineSetParameter(java.security.spec.AlgorithmParameterSpec)"> 
     */ 
6
CodeRank
This code example shows how to use the following methods:
sigParams.init(params.getDERObject().getDEREncoded());
            } 
            catch (IOException e)
            { 
                throw new SignatureException("IOException decoding parameters: " + e.getMessage());
            } 
             
            if (signature.getAlgorithm().endsWith("MGF1"))
            { 
                try 
                { 
                    signature.setParameter(sigParams.getParameterSpec(PSSParameterSpec.class));
                } 
                catch (GeneralSecurityException e)
                { 
                    throw new SignatureException("Exception extracting parameters: " + e.getMessage());
                } 
            } 
        } 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Assertion: constructs SignatureException when <code>cause</code> is 
     * null 
     */ 
    public void testSignatureException04() { 
        Throwable cause = null;
        SignatureException tE = new SignatureException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>SignatureException(Throwable)</code> constructor 
     * Assertion: constructs SignatureException when <code>cause</code> is not 
     * null 
     */ 
    public void testSignatureException05() { 
        SignatureException tE = new SignatureException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
6
CodeRank
This code example shows how to use the following methods:getMessage
 
                return rawSignature.verify(expected);
            } 
            catch (SignatureException e)
            { 
                throw new RuntimeOperatorException("exception obtaining raw signature: " + e.getMessage(), e);
            } 
        } 
    } 
 
    private class SignatureOutputStream 
        extends OutputStream
    { 
        private Signature sig;
 
        SignatureOutputStream(Signature sig)
        { 
            this.sig = sig;
        } 
 
6
CodeRank
This code example shows how to use the following methods:getMessage
        try { 
            cert = this.ca.signNewCertificate(uuid,
                                              keypair.getPublic(),
                                              expires);
        } catch (SignatureException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (InvalidKeyException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (CertificateException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (IOException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } 
 
        try { 
            bootstrap.setX509Cert(cert);
        } catch (CertificateEncodingException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } 
        try { 
5
CodeRank
This code example shows how to use the following methods:getMessage
sig.update(bytes, off, len);
        } 
        catch (SignatureException e)
        { 
            throw new IOException("signature update caused exception: " + e.getMessage());
        } 
    } 
 
    public void write(byte[] bytes)
        throws IOException 
    { 
        try 
        { 
            sig.update(bytes);
        } 
        catch (SignatureException e)
        { 
            throw new IOException("signature update caused exception: " + e.getMessage());
        } 
5
CodeRank
This code example shows how to use the following methods:
sig = encoder.decode(sigBytes);
        } 
        catch (Exception e)
        { 
            throw new SignatureException("error decoding signature bytes.");
        } 
 
        return signer.verifySignature(hash, sig[0], sig[1]);
    } 
 
    protected void engineSetParameter( 
        AlgorithmParameterSpec params)
    { 
        throw new UnsupportedOperationException("engineSetParameter unsupported");
    } 
 
    /** 
     * @deprecated replaced with <a href = "#engineSetParameter(java.security.spec.AlgorithmParameterSpec)"> 
     */ 
5
CodeRank
This code example shows how to use the following methods:
   	        Mac hmacSha1 = Mac.getInstance( "HmacSHA1" );
   	        hmacSha1.init( key ); 
            byte [] rawHmac = hmacSha1.doFinal( signIt.getBytes());
            result = new String( Base64.encodeBase64( rawHmac ));
   	    } catch( Exception e ) {
   		    throw new SignatureException( "Failed to generate keyed HMAC on soap request: " + e.getMessage());
   	    } 
   	    return result.trim();
    } 
    
    private String urlSafe(String value) {
    	try { 
    		if (value != null)
    			return URLEncoder.encode(value, "UTF-8").replaceAll("\\+", "%20");
    		else  
    			return null; 
		} catch (UnsupportedEncodingException e) {
			assert(false); 
		} 
		 
5
CodeRank
This code example shows how to use the following methods:getMessage
            { 
                return stream.verify(expected);
            } 
            catch (SignatureException e)
            { 
                throw new RuntimeOperatorException("exception obtaining signature: " + e.getMessage(), e);
            } 
        } 
    } 
 
    private class RawSigVerifier 
        extends SigVerifier 
        implements RawContentVerifier 
    { 
        private Signature rawSignature;
 
        RawSigVerifier(AlgorithmIdentifier algorithm, SignatureOutputStream stream, Signature rawSignature)
        { 
            super(algorithm, stream);
            this.rawSignature = rawSignature;
5
CodeRank
See Code Examples for Java 8 SignatureException Methods: