asn.1

CDP extension ASN.1 tag

我与影子孤独终老i 提交于 2021-02-17 06:41:05
问题 I'm trying to understand ASN.1 format used in CDP Extension in x509 certificate. When reading the cert from google, I see these code related: 30 26 30 24 a0 22 a0 20 86 1e (url start) according to http://rcardon.free.fr/websign/download/api-x509-ext/be/cardon/asn1/x509/extensions/CRLDistributionPoints.html and http://javadoc.iaik.tugraz.at/iaik_jce/current/iaik/asn1/structures/GeneralNames.html, the GeneralNames should be a SEQUENCE of GeneralName. Why there is a 86 directly without another

Retrieve Subject alternative names of X.509 certificate in java

谁说胖子不能爱 提交于 2020-06-23 06:45:28
问题 I have tried using the solution provided in this link. I am getting following error when i tried reading subject alternative names of X.509 Certificate java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/DERObject; At below line of code ASN1InputStream decoder = new ASN1InputStream((byte[]) item.toArray()); DEREncodable encoded = decoder.readObject(); .der file is used to create certificate as follows. X509Certificate cert=null; fis = new

How to convert OpenSSL digital signature to ASN1?

拥有回忆 提交于 2020-01-25 21:52:33
问题 Using the openssl library I have created a digital signature of a file. I can see that if I use the openssl command: openssl rsautl -verify -inkey pubkey.pem -pubin -asn1parse -in sigfile I get a nice output of something like: 0:d=0 hl=2 l= 49 cons: SEQUENCE 2:d=1 hl=2 l= 13 cons: SEQUENCE 4:d=2 hl=2 l= 9 prim: OBJECT :sha256 15:d=2 hl=2 l= 0 prim: NULL 17:d=1 hl=2 l= 32 prim: OCTET STRING 0000 - c9 8c 24 b6 77 ef f4 48-60 af ea 6f 49 3b ba ec ..$.w..H`..oI;.. 0010 - 5b b1 c4 cb b2 09 c6 fc

Get DN from certificate in ASN.1 format

百般思念 提交于 2020-01-25 21:06:15
问题 I'm trying to get the DN from a certificate in ASN.1/DER format. I have searched OpenSSL but still cannot find the exact function to get the DN. Does anyone have any experience regarding this or can point me to books or any website? 回答1: I already found a way to do this. I just put here if anyone want to do the same. X509_NAME * cert_entry = X509_get_issuer_name(cert); unsigned char buff[100] = {0}; unsigned char * p = buff; int i = i2d_X509_NAME(cert_entry,&p); for(int b = 0;b<i;b++) {

Get DN from certificate in ASN.1 format

不问归期 提交于 2020-01-25 21:05:30
问题 I'm trying to get the DN from a certificate in ASN.1/DER format. I have searched OpenSSL but still cannot find the exact function to get the DN. Does anyone have any experience regarding this or can point me to books or any website? 回答1: I already found a way to do this. I just put here if anyone want to do the same. X509_NAME * cert_entry = X509_get_issuer_name(cert); unsigned char buff[100] = {0}; unsigned char * p = buff; int i = i2d_X509_NAME(cert_entry,&p); for(int b = 0;b<i;b++) {

How to extract data from asn1 data file and load it into a dataframe?

橙三吉。 提交于 2020-01-24 22:11:06
问题 My ultimate goal is to load meta data received from PubMed into a pyspark dataframe. So far, I have managed to download the data I want from the PubMed data base using a shell script. The downloaded data is in asn1 format. Here is an example of a data entry: Pubmed-entry ::= { pmid 31782536, medent { em std { year 2019, month 11, day 30, hour 6, minute 0 }, cit { title { name "Impact of CYP2C19 genotype and drug interactions on voriconazole plasma concentrations: a spain pharmacogenetic

ASN Basic Encoding Rule of an integer

三世轮回 提交于 2020-01-15 10:37:32
问题 I'm currently studying the Abstract Syntax Notation One and reading the ITU-T Recommendation X.690. On page 15 in paragraph 8.3.2, there is written: If the contents octets of an integer value encoding consist of more than one octet, then the bits of the first octet and bit 8 of the second octet: shall not all be ones; and shall not all be zero. NOTE – These rules ensure that an integer value is always encoded in the smallest possible number of octets. I understand that for the integer to be

Generate RSA private key from n, e, d, p, q values in bash with OpenSSL [duplicate]

两盒软妹~` 提交于 2020-01-13 11:24:09
问题 This question already has answers here : How to Generate rsa keys using specific input numbers in openssl? (2 answers) Closed 3 years ago . I have calculated n, e, d, p, q values of an RSA key. Now, how can I generate a private key file (pem or der) with openssl command line tools? I was thinking about openssl asn1parse -genconf asn1.cnf -noout -out asn1.der but I cannot understand how to build the conf file. 回答1: The OpenSSL manpage for asn_generate_nconf comes with an example cnf for

ASN.1 Decode Error

﹥>﹥吖頭↗ 提交于 2020-01-07 07:42:09
问题 I am using Objective System Inc(http://www.obj-sys.com/products/asn1c/index.php) ASN.1 Compiler and the specification file(cdr_spec.asn) generated Java source code. The CDRS are enecoded based on format BER(Basic Encoding Rule) Command to generate Java source: ./asn1c cdr_spec.asn -java -ber -reader -print -getset -pkgname com.testpkg The source is generated: ASN1C Compiler, Version 6.4.5 Copyright (c) 1997-2011 Objective Systems, Inc. All Rights Reserved. Registered to: XXXXXX Parsing ASN.1

SecKeyCreateFromData fails on 10.9 with -2147415792

≡放荡痞女 提交于 2020-01-06 05:47:29
问题 I have a code that constructs an RSA public key on MacOS with the help of the security framework. This works fine on 10.11/10.12/10.13, but today I found that this fails on 10.9. Below is the constructor of the class that wraps the key: CRSAPublicKey(const unsigned char* pExponent, const std::size_t nExponentSize, const unsigned char* pModulus, const std::size_t nModulusSize) { static const SecAsn1Template kRsaPublicKeyTemplate[] = { { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(ASN1_RSA_PUBLIC_KEY) }