@rem *********************************************************************
@rem Copyright (c) 2006, 2008 IBM Corporation and others.
@rem All rights reserved.   This program and the accompanying materials
@rem are made available under the terms of the Eclipse Public License v1.0
@rem which accompanies this distribution, and is available at
@rem http://www.eclipse.org/legal/epl-v10.html
@rem $Id: generateKey.bat,v 1.2 2008/02/29 14:23:34 jkubasta Exp $
@rem
@rem Contributors:
@rem IBM - Initial API and implementation
@rem *********************************************************************
@rem
@setlocal
@set SECURITY_HOME=D:\eclipse\workspace-security\org.eclipse.tptp.platform.agentcontroller\src-native-new\security
@set KEYTOOL=D:\jdk1.4.2_06\bin\keytool

@set CERT=tptpSample.cer
@set KEYSTORE=tptpSamplekeystore

@if exist %SECURITY_HOME%\%CERT% del %SECURITY_HOME%\%CERT%
@if exist %SECURITY_HOME%\%KEYSTORE% del %SECURITY_HOME%\%KEYSTORE%
	
%KEYTOOL% -genkey -alias sample -keyalg RSA -sigalg MD5withRSA -dname "CN=Sample, OU=Sample, O=Sample, C=US" -validity 3650 -keypass password -storetype jks -keystore "%SECURITY_HOME%\%KEYSTORE%" -storepass password
%KEYTOOL% -export -alias sample -file "%SECURITY_HOME%\%CERT%" -keystore "%SECURITY_HOME%\%KEYSTORE%" -storepass password

@endlocal
