<html><body><div dir="ltr"><div style="">
  
  
  
    </div><div style=""><div>
        
        <div dir="ltr">If you can open it readonly, why not do it without any special name and only fail the write operation? Or maybe have a truststore mode, which does not have to open keys?</div><div dir="ltr"><br></div><div dir="ltr">Gruss</div><div dir="ltr">Bernd</div><div id="ms-outlook-mobile-signature"><div style="direction:ltr">-- </div><div style="direction:ltr">http://bernd.eckenfels.net</div></div>
    </div>
  

<div> </div><hr style="display:inline-block;width:98%" tabindex="-1"><div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif"><b>Von:</b> security-dev <security-dev-retn@openjdk.org> im Auftrag von Mat Carter <Matthew.Carter@microsoft.com><br><b>Gesendet:</b> Donnerstag, Juni 1, 2023 3:01 AM<br><b>An:</b> security-dev@openjdk.org <security-dev@openjdk.org><br><b>Betreff:</b> Read only KeyStores?<div> </div></font></div>


<style type="text/css" style="display:none"><!--
p
        {margin-top:0;
        margin-bottom:0;}
--></style>


<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Currently on Windows to access the local machine KeyStores (Windows-MY-LOCALMACHINE and Windows-ROOT-LOCALMACHINE) you need administrator
 privileges.</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">To reduce the need to grant admin privileges to Java applications, I'm proposing that we allow the application to access readonly
 versions of the KeyStores.</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">I'm considering this feature mainly for Windows but am open to general support.</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">However, when looking at how to do this I see two obvious options, but am asking for other options that may fit the API better</span></div>
<ol start="1">
<li style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; list-style-type: "1) "; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Simply duplicate the service strings and append "-READONLY".</span></li><li style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; list-style-type: "2) "; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Get the Provider.Service instance and construct a new KeyStore with a parameter to indicate readonly access.</span></li></ol>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Personally, I'm not fond of (1) as its parameterizing the KeyStore string [I already did this with "-LOCALMACHINE"].</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">However, (2) won't work as the KeyStore constructor (KeyStoreSpi, Provider, String type) is protected </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Is it possible to change the protection on the constructor, or provide a new constructor? (given that the String type is redundant
 as it should always be "KeyStore")<br>
<br>
Any thoughts/concerns about this ?</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Cheers</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Mat</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<p class="elementToProof">Sent from <a href="http://aka.ms/weboutlook" style="margin-top: 0px; margin-bottom: 0px;">
Outlook</a><br>
</p>


</div></div></body></html>