Dear all,
I got a question ,hope you help me , thanks.
My system is SAP PI7.0 SP15, I want to use UDF for signing .
My code is :
InputStream fs;
fs = null;
try
{
fs = getClass().getClassLoader().getResourceAsStream("pkilicense.dat");
if(fs == null)
throw new PKIException("850007", "Read license file failed");
licenseUtil.verifyLicense(fs);
String endDate = licenseUtil.getCustomerProp().getProperty("endDate");
String hostIP = licenseUtil.getHardinfoProp().getProperty("hostIP");
boolean isProbation = licenseUtil.isProbation();
fs.close();
...
}
catch(Exception ex)
{
if(ex instanceof PKIException)
throw (PKIException)ex;
else
throw new PKIException("850007", "Read license file failed " + ex.getMessage(), ex);
}
finally { }
"pkilicense.dat" is file in the JAR Packet , under root directory, the code in the JAR Packet too. when
I use MyEclipse Enterprise WorkBench tool, I could get correct result, but when I use in UDF ,
i got an error message:
18:04:12 Start of test
Document start
Start tag [ns0:MapExampleFlatStructureMessage]
Add raw attribute [ xmlns:ns0="http://F2File.com"]
Start tag [Person]
Start tag [Id]
Put value [Strat:1:c:exception:850007: Read license file failed SHA1WITHRSAENCRYPTION Signature not available java.security.NoSuchAlgorithmException: SHA1WITHRSAENCRYPTION Signature not available]
Close tag [Id]
Close tag [Person]
Close tag [ns0:MapExampleFlatStructureMessage]
Document end
Executed successfully
18:04:14 End of test
I was trying with method that delete "pkilicense.dat" file in JAR Packet , I got the same error message.
I thought the error message is relating to JVM, i have no idea with it .
The correct result is (length:1624):
MIIEvQYJKoZIhvcNAQcCoII...oMVTGLnzBFeiO4hHJ1XUlcmU2c=
The content of pkilicense.dat is
#license
#Tue Feb 17 09:40:37 CST 2009
ERROR_hostIP=IP error
HARDINFO_hostIP=192.168.120.127
VALID_endDate=2009-12-31
PROBATION=true
SN=010020012009...
**pTu+gff0UuzPZFjEZXD2T4TNr1RAsPiYfhZC9gbB/15G8q0XLMEZ2kmnzTTad2Vf6dgkvEta8bY8.....OQyPmpzW39qwe3RJTfo=
Please help me ,thanks very much.
-
Eric
2009-6-11