[prev in list] [next in list] [prev in thread] [next in thread]
List: bouncycastle-crypto-dev
Subject: [dev-crypto] (No subject header)
From: dellanna () csp ! it
Date: 2007-05-21 15:44:40
Message-ID: 1179762280.4651be68cc374 () csa ! csp ! it
[Download RAW message or body]
Hi all,
I tried to use timestamp packet in bouncy castle but I have some problem because
I don't found examples on this package.
In my code I have one sender and one receiver.
On Sender Side I use the following code to create a timestamp:
mydigest= this.CreateDigest(message);
TimeStampRequestGenerator reqGen = new TimeStampRequestGenerator();
TimeStampRequest request= reqGen.generate(TSPAlgorithms.SHA1, mydigest);
byte[] ts=new byte[req.getEncoded().length];
ts=req.getEncoded();
On receiver side I wrote the following code:
TimeStampRequestGenerator reqGen = new TimeStampRequestGenerator();
//ricostruisco il timestamp
TimeStampRequest request= reqGen.generate(TSPAlgorithms.SHA1, ts);
try{
request.validate(TSPAlgorithms.ALLOWED,null,null,"BC");
}
catch (TSPException e)
{System.out.println("The timestamp is invalid");
System.out.println(e);
System.out.println("Autenthication was failed");
return -1;
}
When I run Application I see the following exception: "imprint digest the wrong
length".
what is my problem? can someone advise me any link with some example on
timestamp?
Thanks in advance.
Simone.
"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic