rsa - Dealing with a PublicKey object in Java -
first, time, , patience since i´m noob in subject... have publickey object:
sun rsa public key, 2048 bits modulus: 18077203024541758363929020498733829335491380051700307922133794962061975747420394877143889885945336305414295314139507244695177887549094887061986620463327220586346030432731550617421168238140740600157137764348364595070740870977422155213465409492752709350141858141989090093641680035205975043549124382974765930336756768548921056751935659732417661594872253800976031104054204421629711597470770033907934006101453865340621763385927121144139876123093050849040638804744781745077880021130241262817005818066815987603380244330904985993553253768481242544555268132089382269330678737161421709242927983939704722774178497866252217753513 public exponent: 65537
and need this:
miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeajzlzvhyjxagafmqngrsdj3vistkpy3i3 fow4xrx+wkoebov9k7wfgdb2ptvl+fahhy5mvgghzzfggo0thefzdbqdlzezqbg6uw/qdh4cddjb nfhaziexspfsdlz15i5yizcpvkslm7cuf0oguoq8qxnledfd47mrwp7krt2vtgkrlpkykiue6e/i nrqygpadsv0qytbgzcxqt5wm70iqtjei4ecszgwcwg0aebjo8imv42bh1zk8igs1a/tasleshamy xpqavgf8zhncssaqdzjmzirn1tzuyn2whkpw2mwudvy5acyepmv7izzvtmawjc7g6c8y5my+mmme qmafqqidaqab
(for correct example)
i don´t know how handle kind of object don´t know if it´s pretty dumb or hard achieve.
edit: (further explanation) in case i´m dealing publickey object working net.ripe.commons.certification library since need parse fields of end entity certificate. when public key .getpublickey()
of x509cert, , see show in first code posted. need store in field in database, if instance use .getencode().tostring()
, gives not right. know other application in web second code (which how want save in db) corresponds first one.
thanks
as expected mistake... in case problem ... .getencode().tostring()
, using
string key = base64.encodebase64(x509rc.getpublickey().getencoded()).tostring()
when correct use be
string key = new string(base64.encodebase64(x509rc.getpublickey().getencoded()))
thanks help
Comments
Post a Comment