Tuesday, April 7, 2009

Makecer.exe

makecer.exe



makecer.exe is te tool which omes with the visual studio using this tool we can create self signed certificates.



steps once have to follow to create the self signned document



1. open the visual studio command promt

2. type the foolowing command to check the makecer.exe is installed on your system or not 99.9% it is instaled in your system as it is the tool hich vs provieds you

[code]

makecer

[/code]



3. If the above command works then use the following command to create a certificate.



[code]

makecert -sk "MyContainer" -ss MY -r -n "CN=YourCommonName" mycer.cer

[/code]



this will creates an RSA key-pair and a matching certificate in the CurrentUser "MY" certificate store, and also give the output as a public certificate to the file mycer.cer.



The matching private key is placed in the CryptoAPI keycontainer named "MyContainer"(which contains the encrypted private key for this certificate).

The cert is self-signed (-r) and is exportable with private key (-pe).


You can use that keycontainer name (MyContainer) to instantiate a .NET CSP instance too.





++



Thanks and Regards

Meetu Choudhary

http://msdotnetmentor.com

Isnumeric function in JavaScript

Creating a JavaScrit Functon to check the Numeric Values in a field... Unfortunalltyl which is not there inJavaScript By Default...
the function goes like This

[code]
< SCRIPT language="JavaScript" >
<!--
function chkNumeric(strString)
// strString is the string passed to be checked

// check for valid numeric strings
{
// strvalidchars defines the set of characters which are valid in a numeric field
var strValidChars = "0123456789.-";
// strings
var strChar;
// boolresult is the variable which returns true is string is in correct format or false if it is not a valid numeric string
var boolResult = true;

if (strString.length == 0) return false;
// test strString consists of valid characters listed above
for (i = 0; i < strString.length && boolResult == true; i++)
{
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1)
{
boolResult = false;
}
}
return boolResult;
}

// -->
</SCRIPT>
[/code]

Now once a function is ready we can use it as follows to check a field and returns an error
message if the contents are not numeric:

[code]
if (document.formname.fieldname.value.length == 0)
{
alert("Please enter a value.");
}
else if (chkNumeric(document.formname.fieldname.value) == false)
{
alert("Please check - the string conatins non numeric value!");
}

[/code]





++

Thanks and Regards

Meetu Choudhary

(http://msdotnetmentor.com)

Subscribe via email

Enter your email address:

Delivered by FeedBurner

MSDotnetMentor

MSDotnetMentor My Website http://msdotnetmentor.com