Examples of CipherParameters


Examples of org.bouncycastle.crypto.CipherParameters

    if ( !(publicKey instanceof RSAPublicKey) )
    {
      throw new InvalidKeyException("Supplied key is not a RSAPublicKey instance");
    }

        CipherParameters    param = RSAUtil.generatePublicKeyParameter((RSAPublicKey)publicKey);

        digest.reset();
        cipher.init(false, param);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

    if ( !(privateKey instanceof RSAPrivateKey) )
    {
      throw new InvalidKeyException("Supplied key is not a RSAPrivateKey instance");
    }

        CipherParameters    param = RSAUtil.generatePrivateKeyParameter((RSAPrivateKey)privateKey);

        digest.reset();

        cipher.init(true, param);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

            throw new InvalidAlgorithmParameterException("must be passed IES parameters");
        }

        IESKey       ieKey = (IESKey)key;

        CipherParameters pubKey;
        CipherParameters privKey;

        if (ieKey.getPublic() instanceof JCEECPublicKey)
        {
            pubKey = ECUtil.generatePublicKeyParameter(ieKey.getPublic());
            privKey = ECUtil.generatePrivateKeyParameter(ieKey.getPrivate());
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

  getObfuscatedValue(
    byte[]    plain_key )
  {
        RC4Engine  engine = new RC4Engine();
       
    CipherParameters  params = new KeyParameter( new SHA1Simple().calculateHash( plain_key ));
   
    engine.init( true, params );

    byte[]  temp = new byte[1024];
   
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

  {
      SecretKeySpec  secret_key_spec = new SecretKeySpec( key, "RC4" );
     
      RC4Engine rc4_engine  = new RC4Engine();
   
    CipherParameters  params_a = new KeyParameter( secret_key_spec.getEncoded());
   
      // for RC4 enc/dec is irrelevant
   
    rc4_engine.init( true, params_a );
   
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

       
        RSAEngine  eng = new RSAEngine();
       
        PKCS1Encoding  padded_eng = new PKCS1Encoding( eng );
       
              CipherParameters param = RSAUtil.generatePublicKeyParameter(public_key);
             
              param = new ParametersWithRandom(param, RandomUtils.SECURE_RANDOM);
             
              padded_eng.init( true, param );
       
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

       
        if ( internal_rc4 ){
                 
          rc4_engine  = new RC4Engine();
         
          CipherParameters  params = new KeyParameter(key_spec.getEncoded());
         
          rc4_engine.init( mode == Cipher.ENCRYPT_MODE, params );
        }
       
        //System.out.println( "RC4 key: " + ByteFormatter.encodeString( key_spec.getEncoded()));
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

        if (!(key instanceof ECPublicKey))
        {
            throw new InvalidKeyException("EC Key Agreement doPhase requires ECPublicKey");
        }

        CipherParameters pubKey = ECUtil.generatePublicKeyParameter((PublicKey)key);

        result = agreement.calculateAgreement(pubKey);

        return null;
    }
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

    protected void engineInitVerify(
        PublicKey   publicKey)
        throws InvalidKeyException
    {
        CipherParameters    param = null;

        if (publicKey instanceof ECKey)
        {
            param = ECUtil.generatePublicKeyParameter(publicKey);
        }
View Full Code Here

Examples of org.bouncycastle.crypto.CipherParameters

    protected void engineInitSign(
        PrivateKey  privateKey)
        throws InvalidKeyException
    {
        CipherParameters    param = null;

        if (privateKey instanceof ECKey)
        {
            param = ECUtil.generatePrivateKeyParameter(privateKey);
        }
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.