[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bouncycastle-crypto-dev
Subject:    [dev-crypto] Deprecated interfaces?
From:       Uri Blumenthal <uri () mit ! edu>
Date:       2017-06-23 3:59:05
Message-ID: E90D4F80-A598-41ED-897C-C7CB30B27625 () mit ! edu
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


My code has been using objects like ECPrivateKey for a long time. With 1.57 I've \
noticed this warning message:

- Access restriction: The type 'ECPrivateKey' is not API (restriction on required \
library '/Library/Java/  Extensions/bcprov-ext-jdk15on-157.jar')


What type should I use instead of, e.g., ECPrivateKey? And may I ask why it is \
deprecated?

Thanks!

P.S. Here's an example of how I use it:

	PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
	KeyFactory kf = KeyFactory.getInstance("EC", "BC");
		
	ECPrivateKey priKey = (ECPrivateKey) kf.generatePrivate(pkcs8KeySpec);

	// decrypt the data
	Cipher cipher =  Cipher.getInstance(ALGORITHM, "BC");
	cipher.init(Cipher.DECRYPT_MODE, priKey, rng);

--
Uri Blumenthal
uri@mit.edu


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class="">My code has been using objects like \
<font face=".SF NS Text" class="">ECPrivateKey</font> for a long time. With 1.57 I've \
noticed this warning message:<div class=""><br class=""></div><div class=""><div \
style="margin: 0px; text-indent: 0.1px; font-size: 11px; line-height: normal; \
font-family: '.SF NS Text';" class="">- Access restriction: The type 'ECPrivateKey' \
is not API (restriction on required library '/Library/Java/</div><div style="margin: \
0px; text-indent: 0.1px; font-size: 11px; line-height: normal; font-family: '.SF NS \
Text';" class=""><span class="Apple-tab-span" style="white-space:pre">	</span> \
Extensions/bcprov-ext-jdk15on-157.jar')</div></div><div style="margin: 0px; \
text-indent: 0.1px; font-size: 11px; line-height: normal; font-family: '.SF NS \
Text';" class=""><br class=""></div><div class=""><br class=""></div><div \
class="">What type should I use instead of, e.g., <font face=".SF NS Text" \
class="">ECPrivateKey</font>? And may I ask why it is deprecated?</div><div \
class=""><br class=""></div><div class="">Thanks!</div><div class=""><br \
class=""></div><div class="">P.S. Here's an example of how I use it:</div><div \
class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; \
line-height: normal; font-family: Monaco;" class=""><span class="Apple-tab-span" \
style="white-space:pre">	</span>PKCS8EncodedKeySpec <span style="color: #7e504f" \
class="">pkcs8KeySpec</span> = <span style="color: #931a68" class="">new</span> \
PKCS8EncodedKeySpec(<span style="color: #7e504f" class="">keyBytes</span>);</div><div \
style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" \
class=""><span class="Apple-tab-span" style="white-space:pre">	</span>KeyFactory \
<span style="color: #7e504f" class="">kf</span> = KeyFactory.getInstance(<span \
style="color: #3933ff" class="">"EC"</span>, <span style="color: #3933ff" \
class="">"BC"</span>);</div><p style="margin: 0px; font-size: 11px; line-height: \
normal; font-family: Monaco; min-height: 15px;" class=""><span class="Apple-tab-span" \
style="white-space:pre">		</span><br class="webkit-block-placeholder"></p><div \
style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" \
class=""><span class="Apple-tab-span" style="white-space:pre">	</span><span \
style="text-decoration: underline" class="">ECPrivateKey</span> <span style="color: \
#7e504f" class="">priKey</span> = (<span style="text-decoration: underline" \
class="">ECPrivateKey</span>) <span style="color: #7e504f" \
class="">kf</span>.generatePrivate(<span style="color: #7e504f" \
class="">pkcs8KeySpec</span>);</div><div style="margin: 0px; font-size: 11px; \
line-height: normal; font-family: Monaco; min-height: 15px;" class=""><br \
class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; \
font-family: Monaco; color: rgb(78, 144, 114);" class=""><span style="color: #000000" \
class=""><span class="Apple-tab-span" style="white-space:pre">	</span></span>// \
decrypt the data</div><div style="margin: 0px; font-size: 11px; line-height: normal; \
font-family: Monaco;" class=""><span class="Apple-tab-span" \
style="white-space:pre">	</span>Cipher <span style="color: #7e504f" \
class="">cipher</span> =&nbsp; Cipher.getInstance(<span style="color: #0326cc" \
class="">ALGORITHM</span>, <span style="color: #3933ff" \
class="">"BC"</span>);</div><div style="margin: 0px; font-size: 11px; line-height: \
normal; font-family: Monaco;" class=""><span class="Apple-tab-span" \
style="white-space:pre">	</span><span style="color: #7e504f" \
class="">cipher</span>.init(Cipher.<span style="color: #0326cc" \
class="">DECRYPT_MODE</span>, <span style="color: #7e504f" class="">priKey</span>, \
<span style="color: #0326cc" class="">rng</span>);</div><div style="margin: 0px; \
font-size: 11px; line-height: normal; font-family: Monaco;" class=""><br \
class=""></div><div class=""> <div style="orphans: 2; widows: 2;" \
class="">--</div><div style="orphans: 2; widows: 2;" class="">Uri \
Blumenthal</div><div style="orphans: 2; widows: 2;" class=""><a \
href="mailto:uri@mit.edu" class="">uri@mit.edu</a></div>

</div>
<br class=""></div></body></html>


["smime.p7s" (smime.p7s)]

0	*H
 010	+0	*H
 a00 W0
	*H
010UForest CA RSA 40
160719204734Z
190719204734Z010U
Uri the Great0"0
	*H
0
oVVёc\	
g
ĨmLgNM;*UIepQHL3:Wu=_4v1Ck*T?:"J 4D \
jr@UϿЉQzpk H›}ck􌒭Hdvn~Xg!Ϧ=Tꔏf|0\B.qwNٟV._zg,wT \
HZBJmsuqD}4I27`JRꗃF \
4Q`^{0y0U00AU%705++ +7
	*H/+0U0U0
uri@mit.edu0
	*H
&h[yW'$%t*xBx;eymZfryBt \
L;z,ͨ4ؾ1JaqFX \
7ܩAx|Q@R:ma,(HB&<e}byp4MdbU+e96fAج嶝T<"Tw[g4 \
[w(5 WUg1	N\NoXRmo{*+~Qvܚ8αLj޸Y?Թ1GgZ% \
5ú55R+xعkOMތx.'K!k>%>N2EE3J]L'Սd{Ɍ-sSTHAYx$<ǃ00 \
W0 	*H
010UForest CA RSA 40
160719204853Z
190719204853Z010U
Uri the Great0"0
	*H
0
#ޝ߂P7~:~]R זh!NOX%%!b}JZmx	B
N'ˁяS2]UDYnW@":gm"$
|~XjHXd8[~fa2rmέ ) \
;ɵ|~ǃ53DvzxƤkTmQ-R*"P!gRb-,u}!ESƮZ8}ٔ8>lp"(}k4nN6ѣ~0|0U00U \
0U0 uri@mit.edu0UAJsY0%U%0+
+7
U%0
	*H
.Xr۰Kd'unL>$h{%(.vv87>E |ޮ
=,n
TI鳴e6RZ~Zl6~)	g^=!E$rp3|HV \
bѰyDd'{.mw  \
Q$hz	p||dM%V""GC8m6魘K@6OvS \
됬z%(Jses%KyGpC|$)F~ W"YIxTӕa7 \
yC3;I4abW}plSꞎf85 hͪ;I 9-LOv(U 10 \
0"010UForest CA RSA 4W0	+ 0	*H 	1	*H
0	*H
	1
170623035902Z0#	*H
	1.6o"ċ9R01	+71$0"010UForest CA RSA \
4W03*H 	1$ "010UForest CA RSA 4W0
	*H
28v}iV
ձO`kVPtT#%*{Ta[΄xu< \
3_"ҺބXGZJ&O~}9hM5 \
Yh|.xsV)ތKCk~1- ܇݆lztm \
E͈ԥ7ۍŒ"_qh;;oT5s sGX<191(9w,
0w'(4.Q< è



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic