use of org.kse.gui.error.DError in project keystore-explorer by kaikramer.
the class DNetscapeSslServerName method okPressed.
private void okPressed() {
String netscapeSslServerNameStr = jtfNetscapeSslServerName.getText().trim();
if (netscapeSslServerNameStr.length() == 0) {
JOptionPane.showMessageDialog(this, res.getString("DNetscapeSslServerName.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
DERIA5String netscapeSslServerName = new DERIA5String(netscapeSslServerNameStr);
try {
value = netscapeSslServerName.getEncoded(ASN1Encoding.DER);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
closeDialog();
}
use of org.kse.gui.error.DError in project keystore-explorer by kaikramer.
the class DPolicyMappings method okPressed.
private void okPressed() {
PolicyMappings policyMappings = jpmPolicyMappings.getPolicyMappings();
ASN1Sequence policyMappingsSeq = (ASN1Sequence) policyMappings.toASN1Primitive();
if (policyMappingsSeq.size() == 0) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyMappings.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
try {
value = policyMappings.getEncoded(ASN1Encoding.DER);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
closeDialog();
}
use of org.kse.gui.error.DError in project keystore-explorer by kaikramer.
the class DSubjectInformationAccess method okPressed.
private void okPressed() {
List<AccessDescription> accessDescriptions = jadAccessDescriptions.getAccessDescriptions();
if (accessDescriptions.size() == 0) {
JOptionPane.showMessageDialog(this, res.getString("DSubjectInformationAccess.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
SubjectInfoAccess subjectInformationAccess = new SubjectInfoAccess(accessDescriptions);
try {
value = subjectInformationAccess.getEncoded(ASN1Encoding.DER);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
closeDialog();
}
use of org.kse.gui.error.DError in project keystore-explorer by kaikramer.
the class DSubjectKeyIdentifier method okPressed.
private void okPressed() {
byte[] keyIdentifier = jkiKeyIdentifier.getKeyIdentifier();
if (keyIdentifier == null) {
JOptionPane.showMessageDialog(this, res.getString("DSubjectKeyIdentifier.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifier(keyIdentifier);
try {
value = subjectKeyIdentifier.getEncoded(ASN1Encoding.DER);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
closeDialog();
}
use of org.kse.gui.error.DError in project keystore-explorer by kaikramer.
the class DViewExtensions method updateExtensionValue.
private void updateExtensionValue() {
int selectedRow = jtExtensions.getSelectedRow();
if (selectedRow == -1) {
jepExtensionValue.setText("");
jbAsn1.setEnabled(false);
} else {
String oid = ((ASN1ObjectIdentifier) jtExtensions.getValueAt(selectedRow, 2)).getId();
byte[] value = extensions.getExtensionValue(oid);
boolean criticality = (Boolean) jtExtensions.getValueAt(selectedRow, 0);
X509Ext ext = new X509Ext(oid, value, criticality);
try {
jepExtensionValue.setText("<html><body>" + ext.getStringValue().replace(X509Ext.INDENT.getIndentChar().toString(), " ").replace(X509Ext.NEWLINE, "<br/>") + "</body></html>");
} catch (Exception ex) {
jepExtensionValue.setText("");
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
}
jepExtensionValue.setCaretPosition(0);
jbAsn1.setEnabled(true);
}
}
Aggregations