René's URL Explorer Experiment


Title: Exception occured while building CMS enveloped data. · Issue #584 · bcgit/bc-java · GitHub

Open Graph Title: Exception occured while building CMS enveloped data. · Issue #584 · bcgit/bc-java

X Title: Exception occured while building CMS enveloped data. · Issue #584 · bcgit/bc-java

Description: Hi, Could you help me with my issue? I try to build CMS enveloped data with my certificate, but exception happens. OS MacOS Mojave v10.14.6 java version 1.8 BC version either 1.60 or 1.62 My code private String createCmsData(X509Certific...

Open Graph Description: Hi, Could you help me with my issue? I try to build CMS enveloped data with my certificate, but exception happens. OS MacOS Mojave v10.14.6 java version 1.8 BC version either 1.60 or 1.62 My code p...

X Description: Hi, Could you help me with my issue? I try to build CMS enveloped data with my certificate, but exception happens. OS MacOS Mojave v10.14.6 java version 1.8 BC version either 1.60 or 1.62 My code p...

Opengraph URL: https://github.com/bcgit/bc-java/issues/584

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exception occured while building CMS enveloped data.","articleBody":"Hi,\r\n\r\nCould you help me with my issue? I try to build CMS enveloped data with my certificate, but exception happens.\r\n- OS\r\nMacOS Mojave v10.14.6\r\n- java version\r\n1.8\r\n- BC version\r\neither 1.60 or 1.62\r\n- My code\r\n```java\r\nprivate String createCmsData(X509Certificate certificate, byte[] data) throws Exception {\r\n    Security.addProvider(new BouncyCastleProvider());\r\n    CMSEnvelopedDataGenerator envelopedGen = new CMSEnvelopedDataGenerator();\r\n    envelopedGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(certificate).setProvider(\"BC\"));\r\n    CMSEnvelopedData ed = envelopedGen.generate(\r\n        new CMSProcessableByteArray(data),\r\n        new JceCMSContentEncryptorBuilder(NISTObjectIdentifiers.id_aes256_CBC).setProvider(\"BC\").build());\r\n\r\n    // encode and return\r\n    ...\r\n}\r\n```\r\n- My certificate\r\n```shell\r\nCertificate:\r\n    Data:\r\n        Version: 3 (0x2)\r\n        Serial Number:\r\n            37:1f:99:d0:37:cd:c1:9a:b2:96:82:d1:fd:85:46:03:14:50:76:3c\r\n    Signature Algorithm: sm2sign-with-sm3\r\n        Issuer: CN = my.ca.local\r\n        Validity\r\n            Not Before: Sep  2 02:14:11 2019 GMT\r\n            Not After : Sep  3 06:39:44 2019 GMT\r\n        Subject: CN = ds1, OU = Sign, O = PKU, L = BJ, ST = BJ, C = CN\r\n        Subject Public Key Info:\r\n            Public Key Algorithm: id-ecPublicKey\r\n                Public-Key: (256 bit)\r\n                pub:\r\n                    04:37:2e:49:4a:92:c1:01:87:e5:09:01:93:05:35:\r\n                    88:ed:2a:af:81:17:41:18:2c:0c:0c:33:11:54:9d:\r\n                    8b:3c:d4:de:16:03:f8:df:fa:08:84:8a:54:1f:49:\r\n                    50:a5:09:d5:e5:0c:d1:83:93:f8:44:fd:e8:70:61:\r\n                    91:28:e5:65:0b\r\n                ASN1 OID: sm2p256v1\r\n                NIST CURVE: SM2\r\n        X509v3 extensions:\r\n            X509v3 Basic Constraints: critical\r\n                CA:FALSE\r\n            X509v3 Authority Key Identifier: \r\n                keyid:AB:46:5A:A6:73:C2:CC:C8:7E:00:76:B7:55:3F:1B:76:1E:7F:E5:FF\r\n\r\n            X509v3 Subject Key Identifier: \r\n                7E:7E:E5:C1:E2:40:F0:B6:FC:FD:2A:56:25:33:D7:B4:35:C6:3E:73\r\n            X509v3 Key Usage: critical\r\n                Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment\r\n    Signature Algorithm: sm2sign-with-sm3\r\n         30:45:02:21:00:f7:86:6b:eb:b1:00:4a:d5:98:99:67:c4:f8:\r\n         8b:07:4d:11:ba:af:21:04:7b:53:90:f0:7b:f0:e4:5c:80:d7:\r\n         4b:02:20:6e:8d:7a:4d:6b:6c:45:c5:7e:02:d2:b2:01:3b:5e:\r\n         2c:50:a3:66:7d:51:d9:84:bc:7a:93:c0:68:28:a7:ce:30\r\n```\r\n- Exception trace\r\n```\r\nexception wrapping content key: cannot create cipher: No such algorithm: 1.2.840.10045.2.1\r\norg.bouncycastle.cms.CMSException: exception wrapping content key: cannot create cipher: No such algorithm: 1.2.840.10045.2.1\r\n\tat org.bouncycastle.cms.KeyTransRecipientInfoGenerator.generate(Unknown Source)\r\n\tat org.bouncycastle.cms.CMSEnvelopedDataGenerator.doGenerate(Unknown Source)\r\n\tat org.bouncycastle.cms.CMSEnvelopedDataGenerator.generate(Unknown Source)\r\n\t...\r\nCaused by: org.bouncycastle.operator.OperatorCreationException: cannot create cipher: No such algorithm: 1.2.840.10045.2.1\r\n\tat org.bouncycastle.operator.jcajce.OperatorHelper.createAsymmetricWrapper(Unknown Source)\r\n\tat org.bouncycastle.operator.jcajce.JceAsymmetricKeyWrapper.generateWrappedKey(Unknown Source)\r\n\t... 10 more\r\nCaused by: java.security.NoSuchAlgorithmException: No such algorithm: 1.2.840.10045.2.1\r\n\tat javax.crypto.Cipher.getInstance(Cipher.java:687)\r\n\tat javax.crypto.Cipher.getInstance(Cipher.java:595)\r\n\tat org.bouncycastle.jcajce.util.NamedJcaJceHelper.createCipher(Unknown Source)\r\n\t... 12 more\r\n```","author":{"url":"https://github.com/919704371","@type":"Person","name":"919704371"},"datePublished":"2019-09-02T03:01:39Z","url":"https://github.com/bcgit/bc-java/issues/584"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a8ddd632-0f64-1bfd-38b2-80c3f21a5b4b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCDB8:2AB944:4677CC:5E7AA2:6AFBECD5
html-safe-nonce66db9a41a8cfcae5d23b9424873c8d55ce0969978c6aa9bb4f7b18bacf59de5a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREI4OjJBQjk0NDo0Njc3Q0M6NUU3QUEyOjZBRkJFQ0Q1IiwidmlzaXRvcl9pZCI6IjEwNTU4NzM1NDIwNzI4MjI5OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacab040b1ffabe100207e5768d1052e0ef3a7643a661801dfe416495257256ce14
hovercard-subject-tagissue:487971759
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bcgit/bc-java/584/issue_layout
twitter:imagehttps://opengraph.githubassets.com/817584c8b098c283aecdd6a255d3340d6f0e39803ed608322c8e3d2db9161cde/bcgit/bc-java/issues/584
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/817584c8b098c283aecdd6a255d3340d6f0e39803ed608322c8e3d2db9161cde/bcgit/bc-java/issues/584
og:image:altHi, Could you help me with my issue? I try to build CMS enveloped data with my certificate, but exception happens. OS MacOS Mojave v10.14.6 java version 1.8 BC version either 1.60 or 1.62 My code p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:username919704371
hostnamegithub.com
expected-hostnamegithub.com
None744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec
turbo-cache-controlno-preview
go-importgithub.com/bcgit/bc-java git https://github.com/bcgit/bc-java.git
octolytics-dimension-user_id4566970
octolytics-dimension-user_loginbcgit
octolytics-dimension-repository_id10416648
octolytics-dimension-repository_nwobcgit/bc-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id10416648
octolytics-dimension-repository_network_root_nwobcgit/bc-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedf859c48a4c8b4c0009c19bb4e82101aacb4b998
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/bcgit/bc-java/issues/584#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F584
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F584
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=bcgit%2Fbc-java
Reloadhttps://github.com/bcgit/bc-java/issues/584
Reloadhttps://github.com/bcgit/bc-java/issues/584
Reloadhttps://github.com/bcgit/bc-java/issues/584
bcgithttps://github.com/bcgit
bc-javahttps://github.com/bcgit/bc-java
Codehttps://github.com/bcgit/bc-java
Issues47 (47)https://github.com/bcgit/bc-java/issues
Pull requests18 (18)https://github.com/bcgit/bc-java/pulls
Discussionshttps://github.com/bcgit/bc-java/discussions
Actionshttps://github.com/bcgit/bc-java/actions
Projectshttps://github.com/bcgit/bc-java/projects
Wikihttps://github.com/bcgit/bc-java/wiki
Security and qualityhttps://github.com/bcgit/bc-java/security
Insightshttps://github.com/bcgit/bc-java/pulse
https://github.com/bcgit/bc-java
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/584
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/584
Exception occured while building CMS enveloped data.https://github.com/bcgit/bc-java/issues/584#top
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
https://github.com/919704371
919704371https://github.com/919704371
on Sep 2, 2019https://github.com/bcgit/bc-java/issues/584#issue-487971759
https://github.com/AingeZzz
AingeZzzhttps://github.com/AingeZzz
on Jan 6, 2020https://github.com/bcgit/bc-java/issues/584#issuecomment-570983417
winfriedgerlachhttps://github.com/winfriedgerlach
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
on Dec 12, 2024https://github.com/bcgit/bc-java/issues/584#event-15630162500
https://github.com/dghgit
dghgithttps://github.com/dghgit
on May 3, 2026https://github.com/bcgit/bc-java/issues/584#issuecomment-4365536427
https://www.bouncycastle.org/betashttps://www.bouncycastle.org/betas
dghgithttps://github.com/dghgit
completedhttps://github.com/bcgit/bc-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 3, 2026https://github.com/bcgit/bc-java/issues/584#event-25103482120
hubothttps://github.com/hubot
on May 3, 2026https://github.com/bcgit/bc-java/issues/584#event-25106398138
Added support for SM2 as a CMS KeyTransport cipher, relates to github #…https://github.com/bcgit/bc-java/commit/5490432cc7cf98722554d3fe793f8ec5fdcbd791
#…https://github.com/bcgit/bc-java/issues/584
5490432https://github.com/bcgit/bc-java/commit/5490432cc7cf98722554d3fe793f8ec5fdcbd791
Added certificate based SM2 test, relates to github #584https://github.com/bcgit/bc-java/commit/cbfae0850dc85681088158404b2e45d4c542d6a0
#584https://github.com/bcgit/bc-java/issues/584
cbfae08https://github.com/bcgit/bc-java/commit/cbfae0850dc85681088158404b2e45d4c542d6a0
Sign up for freehttps://github.com/signup?return_to=https://github.com/bcgit/bc-java/issues/584
Sign in to commenthttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/584
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.