[Mono-list] Question about RSACryptoServiceProvider...

2003-09-05 Thread Giuseppe Greco
Hi all,

I'm trying to understand how RSACryptoServiceProvider works.

If I've well understood, the following code generates the
public/private key pair:

RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

Then, the following code retrieves the public key:

RSAParamters publicKey = rsa.ExportParameters(false);

and the following code retrieves the private key:

RSAParametes privateKey = rsa.ExportParamters(true);

Well, the question is: How does the Encrypt/Decrypt
method know which key to use?

In my specific case, sometime I need to Encrypt with
the private key and Decrypt with the public key, and
sometime I need to Encrypt with the public key and
Decrypt with the private key...

Could somebody explain me this point one time for ever?
I've give a look at the msdn documentation, but it is
a little bit unclear, since it doesn't explain this
issue.

Thanks a lot,
Gius_.

-- 

Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Problem with System.Cryptography.RSAParameters...

2003-09-05 Thread Giuseppe Greco
On Sat, 2003-09-06 at 01:49, Sebastien Pouliot wrote:
> Gius,
> 
> This is probably because
> (a)   params is a reserved keyword with C# - i.e. your 2 sample lines won't
> compile with VS.NET, or

Yes, by renaming this variable (e.g. parameters),
the code compiles fine...

(arrch! I didn't know that params is a reserved keyword).

> (b)   RSA is a (abstract) class from which RSACryptoServiceProvider inherits
> (and it, somehow, mess up with mcs).

Thank you all,
Gius_.

> 
> Sebastien Pouliot
> Security Architect, Motus Technologies, http://www.motus.com/
> work: [EMAIL PROTECTED]
> home: [EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Giuseppe Greco
> Sent: 5 septembre 2003 16:16
> To: Mono
> Subject: [Mono-list] Problem with System.Cryptography.RSAParameters...
> 
> 
> Hi all,
> 
> does anybody know why the following code does not compile?
> 
> using System.Cryptography;
> 
> RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
> ...
> RSAParameters params = RSA.ExportParameters(false); // does not compile
> ...
> 
> The compiler always complies like this:
> 
> syntax error, expecting OPEN_BRACKET OPEN_PARENS DOT COLON ASSIGN STAR
> OP_INC OP_DEC OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN OP_ADD_ASSIGN
> OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN
> OP_XOR_ASSIGN OP_OR_ASSIGN OP_PTR IDENTIFIER
> 
> gekkota/src/Gekkota.Security/Gekkota.Security.Cryptography/AsymmetricCryptor
> .cs(405) error CS1002: Expecting `;'
> 
> The code above does compile with csc on Windows.
> 
> Thanks,
> Gius_.
> 
> 
> --
> 
> Giuseppe Greco
> 
> ::agamura::
> 
> phone:  +41 (0)91 604 67 65
> mobile: +41 (0)76 390 60 32
> email:  [EMAIL PROTECTED]
> web:www.agamura.com
> 
> 
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
-- 

Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Problem with System.Cryptography.RSAParameters...

2003-09-05 Thread Sebastien Pouliot
Gius,

This is probably because
(a) params is a reserved keyword with C# - i.e. your 2 sample lines won't
compile with VS.NET, or
(b) RSA is a (abstract) class from which RSACryptoServiceProvider inherits
(and it, somehow, mess up with mcs).

Sebastien Pouliot
Security Architect, Motus Technologies, http://www.motus.com/
work: [EMAIL PROTECTED]
home: [EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Giuseppe Greco
Sent: 5 septembre 2003 16:16
To: Mono
Subject: [Mono-list] Problem with System.Cryptography.RSAParameters...


Hi all,

does anybody know why the following code does not compile?

using System.Cryptography;

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
...
RSAParameters params = RSA.ExportParameters(false); // does not compile
...

The compiler always complies like this:

syntax error, expecting OPEN_BRACKET OPEN_PARENS DOT COLON ASSIGN STAR
OP_INC OP_DEC OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN OP_ADD_ASSIGN
OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN
OP_XOR_ASSIGN OP_OR_ASSIGN OP_PTR IDENTIFIER

gekkota/src/Gekkota.Security/Gekkota.Security.Cryptography/AsymmetricCryptor
.cs(405) error CS1002: Expecting `;'

The code above does compile with csc on Windows.

Thanks,
Gius_.


--

Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] problem building from cvs

2003-09-05 Thread Chris Turchin
hi,

i cannot do a make fullbuild  since updating from cvs a couple hours
back:
 
make[2]: Entering directory
`/home/chris/Documents/Projects/mcs/class/System.XML'
make[2]: *** No rule to make target
`Mono.Xml.Schema/XsdParticleValidationState.cs', needed by
`../../build/deps/System.Xml.dll.stamp'.  Stop.
make[2]: Leaving directory
`/home/chris/Documents/Projects/mcs/class/System.XML'make[1]: ***
[all-recursive] Error 1
make[1]: Leaving directory `/home/chris/Documents/Projects/mcs/class'
make: *** [mcs-rest] Error 2


did i forget something?


regards,
--chris

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Problem with System.Cryptography.RSAParameters...

2003-09-05 Thread A Rafael D Teixeira
It is probably a bug in mcs. Report it on bugzilla, but I will also ask a 
favor, run mcs with the -v option and attach the 'verbose parsing' output it 
will spit to the bugzilla case.

With that monstrous log is easier for the mcs maintainers to diagnose the 
problem. To make it smaller, compile the smallest amount of code, just 
enough lines to cause the problem.

Best regards,

Rafael Teixeira
Brazilian Polymath
Mono Hacker since 16 Jul 2001
_
MSN Messenger: instale grĂ¡tis e converse com seus amigos. 
http://messenger.msn.com.br

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Problem with System.Cryptography.RSAParameters...

2003-09-05 Thread Giuseppe Greco
Hi all,

does anybody know why the following code does not compile?

using System.Cryptography;

RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
...
RSAParameters params = RSA.ExportParameters(false); // does not compile
...

The compiler always complies like this:

syntax error, expecting OPEN_BRACKET OPEN_PARENS DOT COLON ASSIGN STAR
OP_INC OP_DEC OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN OP_ADD_ASSIGN
OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN
OP_XOR_ASSIGN OP_OR_ASSIGN OP_PTR IDENTIFIER
   
gekkota/src/Gekkota.Security/Gekkota.Security.Cryptography/AsymmetricCryptor.cs(405) 
error CS1002: Expecting `;'

The code above does compile with csc on Windows.

Thanks,
Gius_.


-- 

Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Barcelona, Mexico, Madrid.

2003-09-05 Thread Miguel de Icaza
Hey guys,

   Am doing some trips again, if you want to meet up in any of those
cities, drop me an email.

   Barcelona:Sep 6th-Sep 11th.
   Mexico City:  Sep 11th-Sep 20th
   Boston:   Sep 21th
   Madrid:   Sep 22st-Sep 24th

Miguel.
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Script to start mod-mono-server and httpd

2003-09-05 Thread John (Doc) Soliday
Rather than attempt to modify the /etc/rc.d/init.d/httpd file, I decided
to approach this a different way.  I will probably create
/etc/rc.d/init.d/mono script eventually, but for now I did the following
scripts (start and stop).  /usr/local/xsp is the xsp directory and it
contains a mono sub-dir as mentioned in previous emails.  You can put
these in /usr/local/bin or something else that is in your path.

start_mono_and_httpd

#! /bin/sh

echo "Starting 'mono mod-mono-server.exe'"
cd /usr/local/xsp
mono mod-mono-server.exe &
PROCEED="no"
while [ "$PROCEED" = "no" ];do
  echo "Waiting for /tmp/mod_mono_server to be created"
  if [ -S "/tmp/mod_mono_server" ];then
echo "Fixing ownership of /tmp/mod_mono_server"
chown apache:apache /tmp/mod_mono_server
PROCEED="yes"
  fi
  sleep 5
done
/etc/rc.d/init.d/httpd start

stop_mono_and_apache

#! /bin/sh

/etc/rc.d/init.d/httpd stop
cd /usr/local/xsp
PROCESS=`ps -ef | grep 'mod\-mono\-server.exe'`
echo "$PROCESS"
for PID in `echo "$PROCESS" | awk '{print $2}'`;do
  echo "Killing $PID"
  kill $PID
done

-- 
John (Doc) Soliday
Commerce Services
(404) 652-3343
[EMAIL PROTECTED]


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] mod_mono working!

2003-09-05 Thread John (Doc) Soliday
I figured out why the index.aspx wasn't showing the list of files.  The
index.aspx uses "." for the directory to obtain the list from.  Since
mono must be started from one level below the mono directory (which is a
link to test in the xsp server directory), a listing of "." shows no
aspx files.  When I changed index.aspx to use "mono" vs. ".", it worked
like a champ!

Thanks to everyone for your help!

-- 
John (Doc) Soliday
Commerce Services
(404) 652-3343
[EMAIL PROTECTED]


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Compiling on Mono on OS X

2003-09-05 Thread Matthieu Cormier

After some time off I am trying to compile mono on OS X again.
I have 0.22 installed on my machine and am trying to compile the latest
sources from CVS.

I uninstalled glib2 and reinstalled with darwinPorts (similar to fink).
This eliminated the following glib error when running Mono 0.22
--
GLib: Cannot convert message: Conversion from character set 'UTF-8' to
'en_US' is not supported
---

I then modified autogen.sh to point to glibtool instead of libtool
and added the ACLOCAL_FLAGS in autgen.sh.  Thank you Paolo for the
pointers.

currently doing a make crashes on mini.  I think I'm really close now. I
believe I read somewhere that mini is the JIT compilere and not supported
on Macs.  Should I be passing a parameter to make?

A more detailed install log follows below.

M@


September 4th Trying to install again
-

sudo make uninstall  [glib 2.0]
installed darwinPorts
sudo port install glib2

This is a slight hack but I don't feel like recompiling my working
mono 0.22 version 

sudo ln -s /opt/local/lib/libgmodule-2.0.0.dylib
/usr/local/lib/libgmodule-2.0.0.dylib
sudo ln -s /opt/local/lib/libglib-2.0.0.dylib
/usr/local/lib/libglib-2.0.0.dylib

-- end of hack 

try mcs hello.cs and see if it compiles

mcs compiles and the old GLib error message no longer appears

OLD GLib messge

GLib: Cannot convert message: Conversion from character
set 'UTF-8' to
'en_US' is not supported

add "alias='/usr/bin/glibtool' " to autogen.sh

./autogen.sh --prefix=/usr/local

Got the following error
--
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
./configure: line 8054: syntax error near unexpected token
`PKG_CHECK_MODULES(BASE_DEPENDENCIES,'
./configure: line 8054: `PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >=
$GLIB_REQUIRED_VERSION)'
--


Added
ACLOCAL_FLAGS="-I /opt/local/share/aclocal"
right before call to aclocal in autogen.sh

./autogen.sh --prefix=/usr/local
make clean
make

still getting errors during compile of mini
EXAMPLE 
../../mono/utils/.libs/libmonoutils.al(strtod.lo) definition of
___bsd_dtoa in section (__TEXT,__text)
../../mono/utils/.libs/libmonoutils.al(strtod.lo) definition of
___bsd_dtoa in section (__TEXT,__text)
ld: multiple definitions of symbol _bsd_strtod
../../mono/utils/.libs/libmonoutils.al(strtod.lo) definition of
_bsd_strtod in section (__TEXT,__text)
../../mono/utils/.libs/libmonoutils.al(strtod.lo) definition of
_bsd_strtod in section (__TEXT,__text)
-

but no longer getting pkg module dependency error


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Closer still

2003-09-05 Thread John (Doc) Soliday
On Fri, 2003-09-05 at 07:42, John (Doc) Soliday wrote:
> On Thu, 2003-09-04 at 17:39, [EMAIL PROTECTED] wrote:
> > Hi,
> > 
> > As I can see in your mail, at least you get something from the server.
> > Since a few weeks I have a lot of problems with mod_mono, it compiles
> > right but when pointing to mono URL I get a blank page (and no log in
> > error_log). I don't know what's going on. I've got mono CVS, mod_mono
> > CVS and Apache 2.0.43.
> > 
> > Please, answer me with anything...
> 
> Sounds like you may be having the same problem I was.  You have to run
> mono mod-mono-server.exe prior to starting up httpd.  I didn't see this
> in the INSTALL file mod-mono-server.exe creates a socket
> (/tmp/mod_mono_server) that allows apache to communicate to mono (or
> mod_mono).  My experience is you must be in the directory that's one
> level below where the aspx files are when you start mono
> mod-mono-server.exe.  The xsp build puts them in test by default, so I
> linked mono to test (ln -s test mono).

Oh, one more thing...you'll need to do one of the following since
mod-mono-server.exe creates the socket owned by root with permissions
755.  I'm not sure which of these is better (I've done both):

chown apache:apache /tmp/mod_mono_server
chmod 777 /tmp/mod_mono_server

If you don't do one of the above, you'll get permission denied in your
apache error_log because apache can't write to the socket.

> 
> Hope this helps,
> 
> > 
> > See you,
> > 
> > Pedro
-- 
John (Doc) Soliday
Commerce Services
(404) 652-3343
[EMAIL PROTECTED]


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Closer still

2003-09-05 Thread John (Doc) Soliday
On Thu, 2003-09-04 at 17:39, [EMAIL PROTECTED] wrote:
> Hi,
> 
> As I can see in your mail, at least you get something from the server.
> Since a few weeks I have a lot of problems with mod_mono, it compiles
> right but when pointing to mono URL I get a blank page (and no log in
> error_log). I don't know what's going on. I've got mono CVS, mod_mono
> CVS and Apache 2.0.43.
> 
> Please, answer me with anything...

Sounds like you may be having the same problem I was.  You have to run
mono mod-mono-server.exe prior to starting up httpd.  I didn't see this
in the INSTALL file mod-mono-server.exe creates a socket
(/tmp/mod_mono_server) that allows apache to communicate to mono (or
mod_mono).  My experience is you must be in the directory that's one
level below where the aspx files are when you start mono
mod-mono-server.exe.  The xsp build puts them in test by default, so I
linked mono to test (ln -s test mono).

Hope this helps,

> 
> See you,
> 
> Pedro
-- 
John (Doc) Soliday
Commerce Services
(404) 652-3343
[EMAIL PROTECTED]


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list