boeboe / be.boeboe.spongycastle Goto Github PK
View Code? Open in Web Editor NEWLearn to use Spongy/Bouncy Castle (Wrox Beginning Cryptography With Java - ISBN 0764596330)
Learn to use Spongy/Bouncy Castle (Wrox Beginning Cryptography With Java - ISBN 0764596330)
Hi,
I am trying to use the new way of generating a PKCS10CertificationRequest using the appropriate builders in the newer API versions but have problems with it that I did not encounter in the old way of generating them.
I have raised a question in stackoverflow with more details on the problem:
http://stackoverflow.com/questions/14470423/pkcs10certificationrequestbuilder-generates-invalid-pkcs10certificationrequest-i
Any help kindly appreciated,
Boeboe
I added a line to output the generated key as below:
System.out.println("cipher : " + Utils.toHex(out));
System.out.println("keyBytes: " + Utils.toHex(keyBytes)); //added
System.out.println("gen key : " + Utils.toHex(sKey.getEncoded()));
System.out.println("gen iv : " + Utils.toHex(cDec.getIV()));
System.out.println("plain : " + Utils.toHex(cDec.doFinal(out)));
I got the following results:
run:
cipher : a7b955896f750665ba71eb50ac3071d9832a8b02760c600bf619a75a0697c87c
keyBytes: 732f2d33c801732b7206756cbd44f9c1c103ddd97c7cbe8e
gen key : 732f2c32c801732a7307756dbc45f8c1c102dcd97c7cbf8f
gen iv : b07bf522c8d608b8
plain : 000102030405060708090a0b0c0d0e0f0001020304050607
BUILD SUCCESSFUL (total time: 3 seconds)
Can somebody tell me why the HEX string of gen key is different from that of keyBytes in some bytes?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.