Package java.security

Examples of java.security.Signature.update()


      // Sort roles before adding it to the signature to preserve the order
      Arrays.sort(roles);
    }
    for (int r = 0; r < roles.length; r++) {
      try {
        signature.update(((String)roles[r]).getBytes());
      } catch (SignatureException e) {
        if (logger.isLoggable(BasicLevel.ERROR))
          logger.log(BasicLevel.ERROR, "EXCEPTION:: validate", e);
        throw new Exception("Cannot add the bytes for the role '" + roles[r] + "' : " + e.getMessage());
      }
View Full Code Here


            break;
          }
         
          if ( output == null ){
           
            sig.update( buffer, 0, len );
           
          }else{
           
            output.write( buffer, 0, len );
          }
View Full Code Here

   
    Signature  sig = Signature.getInstance("MD5withRSA" );

    sig.initVerify( public_key );
   
    sig.update( data.getBytes( "UTF-8" ));
     
    if ( !sig.verify( signature )){
     
      throw( new AEVerifierException( AEVerifierException.FT_SIGNATURE_BAD, "Data verification failed, signature doesn't match data" ));
    }
View Full Code Here

            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            DEROutputStream         dOut = new DEROutputStream(bOut);

            dOut.writeObject(tbsCert);

            sig.update(bOut.toByteArray());
        }
        catch (Exception e)
        {
            throw new SecurityException("exception encoding TBS cert - " + e);
        }
View Full Code Here

    }

    Signature sig = Signature.getInstance(getSigAlgName(), sigProvider);

    sig.initVerify(key);
    sig.update(this.getTBSCertList());
    if ( !sig.verify(this.getSignature()) )
    {
      throw new SignatureException("CRL does not verify with supplied public key.");
    }
  }
View Full Code Here

       
        remotePubKey = CryptoECCUtils.rawdataToPubkey(rawRemoteOtherPubkey);
       
        Signature check = CryptoECCUtils.getSignature(remotePubKey);
 
        check.update(rawRemoteOtherPubkey);
       
        check.update(rawRemoteEphemeralPubkey);
       
        if ( check.verify(remoteSig)){
                   
View Full Code Here

       
        Signature check = CryptoECCUtils.getSignature(remotePubKey);
 
        check.update(rawRemoteOtherPubkey);
       
        check.update(rawRemoteEphemeralPubkey);
       
        if ( check.verify(remoteSig)){
                   
          ecDH.doPhase(CryptoECCUtils.rawdataToPubkey(rawRemoteEphemeralPubkey), true);
         
View Full Code Here

       
        final byte[] remoteSig = getBytes( message, 65535);
             
        Signature check = CryptoECCUtils.getSignature( remotePubKey );
       
        check.update(IV);
         
        check.update(sharedSecret);
         
        if ( !check.verify(remoteSig)){
 
View Full Code Here

             
        Signature check = CryptoECCUtils.getSignature( remotePubKey );
       
        check.update(IV);
         
        check.update(sharedSecret);
         
        if ( !check.verify(remoteSig)){
 
          throw( new CryptoManagerException( "Signature check failed" ));
        }
View Full Code Here

               
        final byte[] rawMyPubkey = CryptoECCUtils.keyToRawdata(myPublicKey);
       
        final byte[] rawEphemeralPubkey = CryptoECCUtils.keyToRawdata(ephemeralKeyPair.getPublic());
       
        sig.update(rawMyPubkey);
         
        sig.update(rawEphemeralPubkey);
         
        final byte[] rawSign = sig.sign();
       
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.