Package java.security

Examples of java.security.Signature.sign()


        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCert);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CertificateObject(new X509CertificateStructure(new DERSequence(v)));
    }
}
View Full Code Here


       
        sig.update(rawMyPubkey);
         
        sig.update(rawEphemeralPubkey);
         
        final byte[] rawSign = sig.sign();
       
        final byte[] pad = new byte[random.nextInt(32)];
       
        random.nextBytes(pad);
       
View Full Code Here

        sig.update(IV);
       
        sig.update(sharedSecret);
       
        final byte[] rawSig = sig.sign();

        putBytes( buffer, IV, 65535 );

        putBytes( buffer, rawSig, 65535 );
      }
View Full Code Here

    Signature sig = CryptoECCUtils.getSignature( priv );
   
    try{
      sig.update( data );
     
      return( sig.sign());
     
    }catch( Throwable e ){
     
      throw( new CryptoManagerException( "Signature failed", e ));
    }
View Full Code Here

    // control over auto-update process and prevent people from injecting
    // potentially huge bogus updates
 
    signature.update( encode( hash, version, size ));

    return( signature.sign());
  }
 
  protected static boolean
  verify(
    byte[]    public_key,
View Full Code Here

                 
                  error.printStackTrace();
                }
              },
              req,
              sig.sign());
           
          }else{
           
            usage();
          }
View Full Code Here

    try{
      Signature sig = CryptoECCUtils.getSignature( CryptoECCUtils.rawdataToPrivkey( private_key ));

      sig.update( ( name + pk_str + sid_str + version + content ).getBytes( "UTF-8" ));
     
      byte[]  sig_bytes = sig.sign();
     
      /*
      Signature verify = CryptoECCUtils.getSignature( CryptoECCUtils.rawdataToPubkey( public_key ));

      verify.update( ( name + pk_str + sid_str + version + content ).getBytes( "UTF-8" ));
View Full Code Here

        catch (Exception e)
        {
            throw new SecurityException("exception encoding TBS cert request - " + e);
        }

        this.sigBits = new DERBitString(sig.sign());
    }

    /**
     * return the public key associated with the certification request -
     * the public key is created using the BC provider.
View Full Code Here

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCert);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CertificateObject(new X509CertificateStructure(new DERSequence(v)));
    }
}
View Full Code Here

        // Construct the CRL
        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
}
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.