Giter VIP home page Giter VIP logo

be.boeboe.spongycastle's Issues

Fail to generate valid PKCS10CertificationRequest

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

The generated key is little different from keyBytes.

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.