public byte[] decryptMacKey(String encMacKeyBase64,String serverPublicKeyBase64) throws AssociationException {
  byte[] hzz=getDigestedZZ(serverPublicKeyBase64);
  byte[] encMacKey=Base64.decodeBase64(encMacKeyBase64.getBytes());
  if (hzz.length != encMacKey.length)   throw new AssociationException("Encrypted MAC key legth different from shared secret digest length!");
  byte[] macKey=new byte[hzz.length];
  for (int i=0; i < hzz.length; i++) {
    byte b1=hzz[i];
    byte b2=encMacKey[i];
    macKey[i]=(byte)(b1 ^ b2);
  }
  if (DEBUG)   _log.debug("Decrypted MAC key Base64: " + new String(Base64.encodeBase64(macKey)));
  return macKey;
}

public byte [ ] decryptMacKey ( String encMacKeyBase64 , String serverPublicKeyBase64 ) throws AssociationException { byte [ ] hzz = getDigestedZZ ( serverPublicKeyBase64 ) ; byte [ ] encMacKey = Base64 . decodeBase64 ( encMacKeyBase64 . getBytes ( ) ) ; if ( hzz . length != encMacKey . length ) throw new AssociationException ( "Encrypted MAC key legth different from shared secret digest length!" ) ; byte [ ] macKey = new byte [ hzz . length ] ; for ( int i = 0 ; i < hzz . length ; i ++ ) { byte b1 = hzz [ i ] ; byte b2 = encMacKey [ i ] ; macKey [ i ] = ( byte ) ( b1 ^ b2 ) ; } if ( DEBUG ) _log . debug ( "Decrypted MAC key Base64: " + new String ( Base64 . encodeBase64 ( macKey ) ) ) ; return macKey ; }
decrypts the association amc key . the decryption takes palce on the consumer side ( aka rp ) .
