# JCE 1.1 Question

Ron Kurr (kurr@ctron.com)
Thu, 23 Oct 1997 14:28:17 -0400

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Hemma Prafullchandra: "Re: Read certificate information"
- Previous message: Charlie Lai: "Re: javakey's capability"

    Date: Thu, 23 Oct 1997 14:28:17 -0400

    From: Ron Kurr <kurr@ctron.com>

    To: java-security@web2.javasoft.com

    Subject: JCE 1.1 Question

--------------7586892B1374AAE9923110BF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've been playing with the Java Cryptography Engine and I've got a
couple of questions.

* When reading from a CipherInputStream why is the number of bytes
returned from the available() call different from the number of
bytes obtained from a read() call? Shouldn't they be the same?
* Is there any way to tell before hand how many bytes are to be read
from a CipherInputStream before actually making a read() call? I'd
like to know this so I know how much buffer space to allocate for
the read() call.
* Is there a way to use a public-key/private-key encoding scheme? I
saw interfaces for some RSA stuff but couldn't get it to work. I
also tinkered with using keys generated with the javakey tool but
that failed as well.

Thanks,

Ron

--------------7586892B1374AAE9923110BF
Content-Type: multipart/related; boundary="------------C677FE7394BCF5A93A224C88"

--------------C677FE7394BCF5A93A224C88
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've been playing with the Java Cryptography Engine and I've got a couple of questions.

- When reading from a CipherInputStream why is the number of bytes returned from the available() call different from the number of bytes obtained from a read() call? Shouldn't they be the same?
- Is there any way to tell before hand how many bytes are to be read from a CipherInputStream before actually making a read() call? I'd like to know this so I know how much buffer space to allocate for the read() call.
- Is there a way to use a public-key/private-key encoding scheme? I saw interfaces for some RSA stuff but couldn't get it to work. I also tinkered with using keys generated with the javakey tool but that failed as well.

Thanks,

Ron

--------------C677FE7394BCF5A93A224C88
Content-Type: image/jpeg
Content-ID: <part1.344F9740.5883F3BB@ctron.com>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="d:\TEMP\nsmailCI.jpeg"

/9j/4AAQSkZJRgABAgEASABIAAD/7QG4UGhvdG9zaG9wIDMuMAA4QklNA+kAAAAAAHgAAwAA
AEgASAAAAAAC2gIo/+H/4gL5AkYDRwUoA/wAAgAAAEgASAAAAAAC2gIoAAEAAABkAAAAAQAB
AQEAAAABJw8AAQABAAAAAAAAAAAAAAAAAAIAGQGQAAAAAABAAAAAAAAAAAAAAQAAAAAAAAAA
AAAAAAAAAAA4QklNA+0AAAAAABAASAAAAAEAAQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAA
AAA4QklNJxAAAAAAAAoAAQAAAAAAAAACOEJJTQP1AAAAAABIAC9mZgABAGxmZgAGAAAAAAAB
AC9mZgABAKGZmgAGAAAAAAABADIAAAABAFoAAAAGAAAAAAABADUAAAABAC0AAAAGAAAAAAAB
OEJJTQP4AAAAAABwAAD/////////////////////////////A+gAAAAA////////////////
/////////////wPoAAAAAP////////////////////////////8D6AAAAAD/////////////
////////////////A+gAADhCSU0EBgAAAAAAAgAA/+4ADkFkb2JlAGSAAAAAAf/bAIQAEg4O
DhAOFRAQFR4TERMeIxoVFRojIhcXFxcXIhEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwM
DAwMDAwMDAEUExMWGRYbFxcbFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwM
DAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAnQCgAwEiAAIRAQMRAf/EAT8AAAEFAQEBAQEBAAAA
AAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAABBAEDAgQC
BQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHxY3M1
FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm
9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFC
I8FS0fAzJGLhcoKSQ1MVY3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ePZMGz
/FJC5JJ118Eo57caz4p3MABiDHeUzBPuPb5JKVtmABB7qbRAInXuFDcIga+acPcHAQJPzSU/
/9bo9zjuj87VJskEamdSk5sDc3g8a9kmOAOvfyn/AKpSMTFobOvCYA7tPkpcEkKOk/xSSkDy
ND2TWRDY8EzY3DuCpENieCOQkhgG6/wUmgnw/DkpANII8BoohzhoDASUuXASAOdfgmALiJnx
J5Ug0EST7ede5/OUSZjWfLwSUp/OnCUk6TKYg8p9I/KElMgXDjXSE7XAkNiIQz4DhSb3nwSU
uSDI7eKiCQTpzqRr/wB9SiYKWmm6dElMtzjuj87VJskEamdSk5sDc3g8a9kmOAOvfyn/AKpJ
TFobOvCYA7tPkpcEkKOk/wAUkv8A/9fowWgCeDOiiedNY1kJT8tUiO/IUjEvqBI4KidPFSiG
66SmI7GBCSlCBB105Sk7p7p/4cCEw050PwSUoSDOmikT7ZiJ4UdZ0+9SZrKSlTpBiP4qDVLT
slAj+KSljrr2H5VJ3AI08wk7Z8kmOn2nUdh2SUxjQETr48JN1MHX4aqWxwMAz/r/AOZJNYRq
f7klMToCOUi0gAnjskdSna6OySlwWgCeDOiiedNY1kJT8tUiO/ISUvqBI4KidPFSiG66SmI7
GBCSn//Q6DtHPgiSATyJHZNZt0/gpDbJ3eGikYkbjuJP3JgpPifb+HCjp85SUzZoSOD+VO4N
2y46n8VFk7xz5JO58+8pKUQY7Rx/35IEN01+I50/OS8J+j/FM76R2/JJSQQ525o+I7qLnanb
omG7YeYTaxpz38UlLEDskCQZ7hLt+VI9kEpwS5sjTxjxUQ8DUkzMnzS/MG2J/wClP9lD/N+a
KFzE6jnUGeyR9rtPuPcJnctnw8lN2zcPBJSPtHPgiSATyJHZNZt0/gpDbJ3eGiSkbjuJP3Jg
pPifb+HCjp85SU//2Q==
--------------C677FE7394BCF5A93A224C88--

--------------7586892B1374AAE9923110BF--

- Next message: Hemma Prafullchandra: "Re: Read certificate information"
- Previous message: Charlie Lai: "Re: javakey's capability"