-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can the rawValue from ASN1Object be used as a certificate Data? #37
Comments
`var pkcs7 = try PKCS7(data: data!) public init(data: Data) throws {
public var certificate: X509Certificate? { I tried to get mainBlock.sub(1)?.sub(1)?.sub?.first.rawValue and use it as certificateData. But it doesn't work. |
P7B have a slightly different encoding, here a sample code to read all the certificates without modifications:
|
@alam156 I'm trying to get and use certificateData. But it doesn't work. Please share your solution. |
@filom I need to create SecCertificate from X509Certificate |
The
|
@filom thank you very much, can I convert X509Certificate to PEM data and create SecCertificate from X509Certificate, without pkcs7? |
To create a SecCertificate you need a certificate in DER format not a PEM. |
I have it. I need convert X509Cetrificate to SecSertificate |
Need get data from x509Certificate object |
If you have a X509Cetrificate object, you must have created it with DER or PEM data, so if you have either one of them you don't have to pass through a X509Cetrificate parser object to recompose it back to a DER object. |
I have modified this library to extract certificate chain from p7b string. I am able to get x509Certificate information using the method x509Certificate(). What i need to do is parse only this Certificate's Data. I tried this with rawValue but in vain. How can i extract only certificate data. In my p7b string, there is 2 certificate. I only need 1st certificate.
The text was updated successfully, but these errors were encountered: