You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use this library through pods (pod 'SelfSignedCert') , after successfully getitng pod . i am importing (import SelfSignedCert) in my class. i am trying to create Self Signed Cert using this code . do {
let (privKey, pubKey) = try SecKey.generateKeyPair(ofSize: 2048)
let certReq = CertificateRequest(forPublicKey: pubKey, subjectCommonName: "bemisalsarfraz", subjectEmailAddress: "[email protected]", keyUsage: [.DigitalSignature, .DataEncipherment])
let signedBytes = certReq.selfSign(withPrivateKey: privKey)!
let signedData = Data(signedBytes)
let signedCert = SecCertificateCreateWithData(nil, signedData as CFData)
} catch {
//handle error
print(error)
}
But i am unable to build my project because it is giving error "Cannot find 'CertificateRequest' in scope".
The text was updated successfully, but these errors were encountered:
I hope this helps; please don't hesitate to ask if you have more questions. Also, please have a look at https://github.com/svdo/swift-SecurityExtensions for some helpers to more easily use SecIdentity, SecCertificate, and SecKey.
I am trying to use this library through pods (pod 'SelfSignedCert') , after successfully getitng pod . i am importing (import SelfSignedCert) in my class. i am trying to create Self Signed Cert using this code .
do {
let (privKey, pubKey) = try SecKey.generateKeyPair(ofSize: 2048)
let certReq = CertificateRequest(forPublicKey: pubKey, subjectCommonName: "bemisalsarfraz", subjectEmailAddress: "[email protected]", keyUsage: [.DigitalSignature, .DataEncipherment])
let signedBytes = certReq.selfSign(withPrivateKey: privKey)!
let signedData = Data(signedBytes)
let signedCert = SecCertificateCreateWithData(nil, signedData as CFData)
} catch {
//handle error
print(error)
}
But i am unable to build my project because it is giving error "Cannot find 'CertificateRequest' in scope".
The text was updated successfully, but these errors were encountered: