use of com.github.zhenwei.core.asn1.ASN1Exception in project keystore-explorer by kaikramer.
the class DViewCsr method asn1DumpPressed.
private void asn1DumpPressed() {
try {
DViewAsn1Dump dViewAsn1Dump;
if (pkcs10Csr != null) {
dViewAsn1Dump = new DViewAsn1Dump(this, pkcs10Csr);
} else {
dViewAsn1Dump = new DViewAsn1Dump(this, spkacCsr);
}
dViewAsn1Dump.setLocationRelativeTo(this);
dViewAsn1Dump.setVisible(true);
} catch (Asn1Exception ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
}
}
use of com.github.zhenwei.core.asn1.ASN1Exception in project keystore-explorer by kaikramer.
the class DViewPrivateKey method asn1DumpPressed.
private void asn1DumpPressed() {
try {
DViewAsn1Dump dViewAsn1Dump = new DViewAsn1Dump(this, privateKey);
dViewAsn1Dump.setLocationRelativeTo(this);
dViewAsn1Dump.setVisible(true);
} catch (Asn1Exception ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
}
}
use of com.github.zhenwei.core.asn1.ASN1Exception in project keystore-explorer by kaikramer.
the class DViewExtensions method asn1DumpPressed.
private void asn1DumpPressed() {
int selectedRow = jtExtensions.getSelectedRow();
if (selectedRow == -1) {
return;
}
String oid = ((ASN1ObjectIdentifier) jtExtensions.getValueAt(selectedRow, 2)).getId();
byte[] value = extensions.getExtensionValue(oid);
boolean criticality = (Boolean) jtExtensions.getValueAt(selectedRow, 0);
X509Ext extension = new X509Ext(oid, value, criticality);
try {
DViewAsn1Dump dViewAsn1Dump = new DViewAsn1Dump(this, extension);
dViewAsn1Dump.setLocationRelativeTo(this);
dViewAsn1Dump.setVisible(true);
} catch (Asn1Exception | IOException e) {
DError.displayError(this, e);
}
}
use of com.github.zhenwei.core.asn1.ASN1Exception in project jmulticard by ctt-gob-es.
the class Dnie method getCdf.
/**
* Obtiene el CDF PKCS#15 del DNIe.
* @return CDF PKCS#15 del DNIe.
* @throws ApduConnectionException Si no se puede conectar con el DNIe.
*/
public Cdf getCdf() throws ApduConnectionException {
final Cdf cdf = new Cdf();
try {
selectMasterFile();
final byte[] cdfBytes = selectFileByLocationAndRead(CDF_LOCATION);
cdf.setDerValue(cdfBytes);
} catch (final IOException | Iso7816FourCardException | Asn1Exception | TlvException e) {
throw new ApduConnectionException(// $NON-NLS-1$
"No se ha podido cargar el CDF de la tarjeta", // $NON-NLS-1$
e);
}
return cdf;
}
use of com.github.zhenwei.core.asn1.ASN1Exception in project jmulticard by ctt-gob-es.
the class Dnie3 method getDg13.
@Override
public OptionalDetails getDg13() throws IOException {
try {
final OptionalDetails ret = new OptionalDetailsDnie3();
ret.setDerValue(selectFileByLocationAndRead(FILE_DG13_LOCATION));
return ret;
} catch (final es.gob.jmulticard.card.iso7816four.FileNotFoundException e) {
// $NON-NLS-1$
throw (IOException) new FileNotFoundException("DG13 no encontrado").initCause(e);
} catch (final Iso7816FourCardException | TlvException | Asn1Exception e) {
// $NON-NLS-1$
throw new CryptoCardException("Error leyendo el DG13", e);
}
}
Aggregations