Does shiro include utilities to encrypt text with a private key?  I
have messed with java.security stuff but it is kinda ugly.

I got this working, and it may be OK it would be better if I could use
a private key to encode and a public one to decode:


    BlowfishCipherService bf = new BlowfishCipherService();
    byte[] key = bf.generateNewKey().getEncoded();
    System.out.println( "Key:"+Base64.encodeToString(key) );

    String txt = "kittens";
    System.out.println( "original: "+txt );

    String out = bf.encrypt(txt.getBytes(), key).toBase64();
    System.out.println( "encrypted: "+out );
    String xxx = new String( bf.decrypt(Base64.decode(out), key).getBytes() );

    System.out.println( "out: "+xxx );


Any pointers would be great!

thanks
ryan

Reply via email to