@salesforce/b2c-tooling-sdk 1.19.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/data/help/index.json +9685 -0
  2. package/data/script-api/index.json +1 -528
  3. package/data/tooling/index.json +4 -4
  4. package/data/xsd/index.json +1 -1
  5. package/dist/esm/cli/base-command.js +5 -0
  6. package/dist/esm/cli/base-command.js.map +1 -1
  7. package/dist/esm/clients/index.d.ts +2 -0
  8. package/dist/esm/clients/index.js +1 -0
  9. package/dist/esm/clients/index.js.map +1 -1
  10. package/dist/esm/clients/middleware-registry.d.ts +1 -1
  11. package/dist/esm/clients/middleware-registry.js.map +1 -1
  12. package/dist/esm/clients/preferences.d.ts +83 -0
  13. package/dist/esm/clients/preferences.generated.d.ts +1651 -0
  14. package/dist/esm/clients/preferences.generated.js +6 -0
  15. package/dist/esm/clients/preferences.generated.js.map +1 -0
  16. package/dist/esm/clients/preferences.js +64 -0
  17. package/dist/esm/clients/preferences.js.map +1 -0
  18. package/dist/esm/config/dw-json.d.ts +2 -0
  19. package/dist/esm/config/dw-json.js.map +1 -1
  20. package/dist/esm/config/mapping.js +4 -0
  21. package/dist/esm/config/mapping.js.map +1 -1
  22. package/dist/esm/config/sources/dw-json-source.js +17 -4
  23. package/dist/esm/config/sources/dw-json-source.js.map +1 -1
  24. package/dist/esm/config/sources/env-source.js +2 -0
  25. package/dist/esm/config/sources/env-source.js.map +1 -1
  26. package/dist/esm/config/types.d.ts +14 -0
  27. package/dist/esm/discovery/detector.d.ts +1 -0
  28. package/dist/esm/discovery/detector.js +3 -1
  29. package/dist/esm/discovery/detector.js.map +1 -1
  30. package/dist/esm/discovery/index.d.ts +1 -1
  31. package/dist/esm/discovery/patterns/cartridges.js +4 -2
  32. package/dist/esm/discovery/patterns/cartridges.js.map +1 -1
  33. package/dist/esm/discovery/patterns/sfra.js +10 -5
  34. package/dist/esm/discovery/patterns/sfra.js.map +1 -1
  35. package/dist/esm/discovery/types.d.ts +20 -1
  36. package/dist/esm/docs/content-cache.d.ts +70 -0
  37. package/dist/esm/docs/content-cache.js +186 -0
  38. package/dist/esm/docs/content-cache.js.map +1 -0
  39. package/dist/esm/docs/index.d.ts +1 -0
  40. package/dist/esm/docs/index.js +2 -0
  41. package/dist/esm/docs/index.js.map +1 -1
  42. package/dist/esm/docs/search.js +34 -6
  43. package/dist/esm/docs/search.js.map +1 -1
  44. package/dist/esm/docs/types.d.ts +6 -1
  45. package/dist/esm/docs/types.js +1 -0
  46. package/dist/esm/docs/types.js.map +1 -1
  47. package/dist/esm/index.d.ts +2 -2
  48. package/dist/esm/index.js +1 -1
  49. package/dist/esm/index.js.map +1 -1
  50. package/dist/esm/operations/code/cartridges.d.ts +18 -0
  51. package/dist/esm/operations/code/cartridges.js +31 -20
  52. package/dist/esm/operations/code/cartridges.js.map +1 -1
  53. package/dist/esm/operations/jobs/discover.d.ts +46 -0
  54. package/dist/esm/operations/jobs/discover.js +87 -0
  55. package/dist/esm/operations/jobs/discover.js.map +1 -0
  56. package/dist/esm/operations/jobs/index.d.ts +2 -0
  57. package/dist/esm/operations/jobs/index.js +2 -0
  58. package/dist/esm/operations/jobs/index.js.map +1 -1
  59. package/dist/esm/operations/jobs/run.js +4 -3
  60. package/dist/esm/operations/jobs/run.js.map +1 -1
  61. package/package.json +5 -3
  62. package/specs/preferences-v1.yaml +2095 -0
  63. package/data/script-api/TopLevel.APIException.md +0 -119
  64. package/data/script-api/TopLevel.Array.md +0 -732
  65. package/data/script-api/TopLevel.ArrayBuffer.md +0 -97
  66. package/data/script-api/TopLevel.BigInt.md +0 -154
  67. package/data/script-api/TopLevel.Boolean.md +0 -83
  68. package/data/script-api/TopLevel.ConversionError.md +0 -51
  69. package/data/script-api/TopLevel.DataView.md +0 -271
  70. package/data/script-api/TopLevel.Date.md +0 -688
  71. package/data/script-api/TopLevel.ES6Iterator.md +0 -47
  72. package/data/script-api/TopLevel.Error.md +0 -124
  73. package/data/script-api/TopLevel.EvalError.md +0 -47
  74. package/data/script-api/TopLevel.Fault.md +0 -133
  75. package/data/script-api/TopLevel.Float32Array.md +0 -186
  76. package/data/script-api/TopLevel.Float64Array.md +0 -186
  77. package/data/script-api/TopLevel.Function.md +0 -114
  78. package/data/script-api/TopLevel.Generator.md +0 -132
  79. package/data/script-api/TopLevel.IOError.md +0 -98
  80. package/data/script-api/TopLevel.Int16Array.md +0 -186
  81. package/data/script-api/TopLevel.Int32Array.md +0 -186
  82. package/data/script-api/TopLevel.Int8Array.md +0 -186
  83. package/data/script-api/TopLevel.InternalError.md +0 -47
  84. package/data/script-api/TopLevel.Iterable.md +0 -44
  85. package/data/script-api/TopLevel.Iterator.md +0 -89
  86. package/data/script-api/TopLevel.JSON.md +0 -173
  87. package/data/script-api/TopLevel.Map.md +0 -189
  88. package/data/script-api/TopLevel.Math.md +0 -948
  89. package/data/script-api/TopLevel.Module.md +0 -152
  90. package/data/script-api/TopLevel.Namespace.md +0 -152
  91. package/data/script-api/TopLevel.Number.md +0 -404
  92. package/data/script-api/TopLevel.Object.md +0 -472
  93. package/data/script-api/TopLevel.QName.md +0 -147
  94. package/data/script-api/TopLevel.RangeError.md +0 -47
  95. package/data/script-api/TopLevel.ReferenceError.md +0 -47
  96. package/data/script-api/TopLevel.RegExp.md +0 -155
  97. package/data/script-api/TopLevel.Set.md +0 -150
  98. package/data/script-api/TopLevel.StopIteration.md +0 -36
  99. package/data/script-api/TopLevel.String.md +0 -1060
  100. package/data/script-api/TopLevel.Symbol.md +0 -196
  101. package/data/script-api/TopLevel.SyntaxError.md +0 -47
  102. package/data/script-api/TopLevel.SystemError.md +0 -99
  103. package/data/script-api/TopLevel.TypeError.md +0 -47
  104. package/data/script-api/TopLevel.URIError.md +0 -47
  105. package/data/script-api/TopLevel.Uint16Array.md +0 -186
  106. package/data/script-api/TopLevel.Uint32Array.md +0 -186
  107. package/data/script-api/TopLevel.Uint8Array.md +0 -186
  108. package/data/script-api/TopLevel.Uint8ClampedArray.md +0 -186
  109. package/data/script-api/TopLevel.WeakMap.md +0 -135
  110. package/data/script-api/TopLevel.WeakSet.md +0 -96
  111. package/data/script-api/TopLevel.XML.md +0 -922
  112. package/data/script-api/TopLevel.XMLList.md +0 -418
  113. package/data/script-api/TopLevel.XMLStreamError.md +0 -115
  114. package/data/script-api/TopLevel.arguments.md +0 -56
  115. package/data/script-api/TopLevel.global.md +0 -539
  116. package/data/script-api/TopLevel.md +0 -58
  117. package/data/script-api/dw.alert.Alert.md +0 -175
  118. package/data/script-api/dw.alert.Alerts.md +0 -256
  119. package/data/script-api/dw.alert.md +0 -7
  120. package/data/script-api/dw.campaign.ABTest.md +0 -63
  121. package/data/script-api/dw.campaign.ABTestMgr.md +0 -76
  122. package/data/script-api/dw.campaign.ABTestSegment.md +0 -107
  123. package/data/script-api/dw.campaign.AmountDiscount.md +0 -70
  124. package/data/script-api/dw.campaign.ApproachingDiscount.md +0 -157
  125. package/data/script-api/dw.campaign.BonusChoiceDiscount.md +0 -190
  126. package/data/script-api/dw.campaign.BonusDiscount.md +0 -59
  127. package/data/script-api/dw.campaign.Campaign.md +0 -346
  128. package/data/script-api/dw.campaign.CampaignMgr.md +0 -436
  129. package/data/script-api/dw.campaign.CampaignStatusCodes.md +0 -103
  130. package/data/script-api/dw.campaign.Coupon.md +0 -324
  131. package/data/script-api/dw.campaign.CouponMgr.md +0 -137
  132. package/data/script-api/dw.campaign.CouponRedemption.md +0 -87
  133. package/data/script-api/dw.campaign.CouponStatusCodes.md +0 -130
  134. package/data/script-api/dw.campaign.Discount.md +0 -271
  135. package/data/script-api/dw.campaign.DiscountPlan.md +0 -322
  136. package/data/script-api/dw.campaign.FixedPriceDiscount.md +0 -74
  137. package/data/script-api/dw.campaign.FixedPriceShippingDiscount.md +0 -74
  138. package/data/script-api/dw.campaign.FreeDiscount.md +0 -24
  139. package/data/script-api/dw.campaign.FreeShippingDiscount.md +0 -24
  140. package/data/script-api/dw.campaign.PercentageDiscount.md +0 -74
  141. package/data/script-api/dw.campaign.PercentageOptionDiscount.md +0 -59
  142. package/data/script-api/dw.campaign.PriceBookPriceDiscount.md +0 -56
  143. package/data/script-api/dw.campaign.Promotion.md +0 -939
  144. package/data/script-api/dw.campaign.PromotionMgr.md +0 -478
  145. package/data/script-api/dw.campaign.PromotionPlan.md +0 -378
  146. package/data/script-api/dw.campaign.SlotContent.md +0 -131
  147. package/data/script-api/dw.campaign.SourceCodeGroup.md +0 -83
  148. package/data/script-api/dw.campaign.SourceCodeInfo.md +0 -167
  149. package/data/script-api/dw.campaign.SourceCodeStatusCodes.md +0 -61
  150. package/data/script-api/dw.campaign.TotalFixedPriceDiscount.md +0 -56
  151. package/data/script-api/dw.campaign.md +0 -36
  152. package/data/script-api/dw.catalog.Catalog.md +0 -158
  153. package/data/script-api/dw.catalog.CatalogMgr.md +0 -161
  154. package/data/script-api/dw.catalog.Category.md +0 -1212
  155. package/data/script-api/dw.catalog.CategoryAssignment.md +0 -179
  156. package/data/script-api/dw.catalog.CategoryLink.md +0 -142
  157. package/data/script-api/dw.catalog.PriceBook.md +0 -215
  158. package/data/script-api/dw.catalog.PriceBookMgr.md +0 -176
  159. package/data/script-api/dw.catalog.Product.md +0 -2492
  160. package/data/script-api/dw.catalog.ProductActiveData.md +0 -1244
  161. package/data/script-api/dw.catalog.ProductAttributeModel.md +0 -409
  162. package/data/script-api/dw.catalog.ProductAvailabilityLevels.md +0 -125
  163. package/data/script-api/dw.catalog.ProductAvailabilityModel.md +0 -516
  164. package/data/script-api/dw.catalog.ProductInventoryList.md +0 -136
  165. package/data/script-api/dw.catalog.ProductInventoryMgr.md +0 -132
  166. package/data/script-api/dw.catalog.ProductInventoryRecord.md +0 -638
  167. package/data/script-api/dw.catalog.ProductLink.md +0 -166
  168. package/data/script-api/dw.catalog.ProductMgr.md +0 -136
  169. package/data/script-api/dw.catalog.ProductOption.md +0 -189
  170. package/data/script-api/dw.catalog.ProductOptionModel.md +0 -209
  171. package/data/script-api/dw.catalog.ProductOptionValue.md +0 -132
  172. package/data/script-api/dw.catalog.ProductPriceInfo.md +0 -170
  173. package/data/script-api/dw.catalog.ProductPriceModel.md +0 -988
  174. package/data/script-api/dw.catalog.ProductPriceTable.md +0 -121
  175. package/data/script-api/dw.catalog.ProductSearchHit.md +0 -702
  176. package/data/script-api/dw.catalog.ProductSearchModel.md +0 -1894
  177. package/data/script-api/dw.catalog.ProductSearchRefinementDefinition.md +0 -99
  178. package/data/script-api/dw.catalog.ProductSearchRefinementValue.md +0 -80
  179. package/data/script-api/dw.catalog.ProductSearchRefinements.md +0 -265
  180. package/data/script-api/dw.catalog.ProductVariationAttribute.md +0 -107
  181. package/data/script-api/dw.catalog.ProductVariationAttributeValue.md +0 -215
  182. package/data/script-api/dw.catalog.ProductVariationModel.md +0 -1010
  183. package/data/script-api/dw.catalog.Recommendation.md +0 -327
  184. package/data/script-api/dw.catalog.SearchModel.md +0 -769
  185. package/data/script-api/dw.catalog.SearchRefinementDefinition.md +0 -145
  186. package/data/script-api/dw.catalog.SearchRefinementValue.md +0 -194
  187. package/data/script-api/dw.catalog.SearchRefinements.md +0 -238
  188. package/data/script-api/dw.catalog.SortingOption.md +0 -120
  189. package/data/script-api/dw.catalog.SortingRule.md +0 -53
  190. package/data/script-api/dw.catalog.Store.md +0 -484
  191. package/data/script-api/dw.catalog.StoreGroup.md +0 -95
  192. package/data/script-api/dw.catalog.StoreInventoryFilter.md +0 -112
  193. package/data/script-api/dw.catalog.StoreInventoryFilterValue.md +0 -111
  194. package/data/script-api/dw.catalog.StoreMgr.md +0 -223
  195. package/data/script-api/dw.catalog.Variant.md +0 -1000
  196. package/data/script-api/dw.catalog.VariationGroup.md +0 -869
  197. package/data/script-api/dw.catalog.md +0 -50
  198. package/data/script-api/dw.content.Content.md +0 -481
  199. package/data/script-api/dw.content.ContentMgr.md +0 -147
  200. package/data/script-api/dw.content.ContentSearchModel.md +0 -618
  201. package/data/script-api/dw.content.ContentSearchRefinementDefinition.md +0 -61
  202. package/data/script-api/dw.content.ContentSearchRefinementValue.md +0 -22
  203. package/data/script-api/dw.content.ContentSearchRefinements.md +0 -218
  204. package/data/script-api/dw.content.Folder.md +0 -432
  205. package/data/script-api/dw.content.Library.md +0 -124
  206. package/data/script-api/dw.content.MarkupText.md +0 -150
  207. package/data/script-api/dw.content.MediaFile.md +0 -367
  208. package/data/script-api/dw.content.md +0 -15
  209. package/data/script-api/dw.crypto.CertificateRef.md +0 -59
  210. package/data/script-api/dw.crypto.CertificateUtils.md +0 -162
  211. package/data/script-api/dw.crypto.Cipher.md +0 -1234
  212. package/data/script-api/dw.crypto.Encoding.md +0 -193
  213. package/data/script-api/dw.crypto.JWE.md +0 -245
  214. package/data/script-api/dw.crypto.JWEHeader.md +0 -147
  215. package/data/script-api/dw.crypto.JWS.md +0 -260
  216. package/data/script-api/dw.crypto.JWSHeader.md +0 -128
  217. package/data/script-api/dw.crypto.KeyRef.md +0 -77
  218. package/data/script-api/dw.crypto.Mac.md +0 -191
  219. package/data/script-api/dw.crypto.MessageDigest.md +0 -243
  220. package/data/script-api/dw.crypto.SecureRandom.md +0 -161
  221. package/data/script-api/dw.crypto.Signature.md +0 -241
  222. package/data/script-api/dw.crypto.WeakCipher.md +0 -725
  223. package/data/script-api/dw.crypto.WeakMac.md +0 -163
  224. package/data/script-api/dw.crypto.WeakMessageDigest.md +0 -220
  225. package/data/script-api/dw.crypto.WeakSignature.md +0 -208
  226. package/data/script-api/dw.crypto.X509Certificate.md +0 -180
  227. package/data/script-api/dw.crypto.md +0 -23
  228. package/data/script-api/dw.customer.AddressBook.md +0 -158
  229. package/data/script-api/dw.customer.AgentUserMgr.md +0 -94
  230. package/data/script-api/dw.customer.AgentUserStatusCodes.md +0 -164
  231. package/data/script-api/dw.customer.AuthenticationStatus.md +0 -157
  232. package/data/script-api/dw.customer.Credentials.md +0 -524
  233. package/data/script-api/dw.customer.Customer.md +0 -488
  234. package/data/script-api/dw.customer.CustomerActiveData.md +0 -563
  235. package/data/script-api/dw.customer.CustomerAddress.md +0 -666
  236. package/data/script-api/dw.customer.CustomerCDPData.md +0 -70
  237. package/data/script-api/dw.customer.CustomerContextMgr.md +0 -62
  238. package/data/script-api/dw.customer.CustomerGroup.md +0 -146
  239. package/data/script-api/dw.customer.CustomerList.md +0 -76
  240. package/data/script-api/dw.customer.CustomerMgr.md +0 -1046
  241. package/data/script-api/dw.customer.CustomerPasswordConstraints.md +0 -125
  242. package/data/script-api/dw.customer.CustomerPaymentInstrument.md +0 -161
  243. package/data/script-api/dw.customer.CustomerStatusCodes.md +0 -55
  244. package/data/script-api/dw.customer.EncryptedObject.md +0 -34
  245. package/data/script-api/dw.customer.ExternalProfile.md +0 -154
  246. package/data/script-api/dw.customer.OrderHistory.md +0 -167
  247. package/data/script-api/dw.customer.ProductList.md +0 -870
  248. package/data/script-api/dw.customer.ProductListItem.md +0 -469
  249. package/data/script-api/dw.customer.ProductListItemPurchase.md +0 -139
  250. package/data/script-api/dw.customer.ProductListMgr.md +0 -350
  251. package/data/script-api/dw.customer.ProductListRegistrant.md +0 -165
  252. package/data/script-api/dw.customer.Profile.md +0 -940
  253. package/data/script-api/dw.customer.Wallet.md +0 -136
  254. package/data/script-api/dw.customer.consent.ConsentStatusEntry.md +0 -92
  255. package/data/script-api/dw.customer.consent.MarketingConsentSubscription.md +0 -247
  256. package/data/script-api/dw.customer.consent.ShopperConsentErrorCodes.md +0 -74
  257. package/data/script-api/dw.customer.consent.ShopperConsentException.md +0 -63
  258. package/data/script-api/dw.customer.consent.ShopperConsentMgr.md +0 -152
  259. package/data/script-api/dw.customer.consent.md +0 -10
  260. package/data/script-api/dw.customer.md +0 -31
  261. package/data/script-api/dw.customer.oauth.OAuthAccessTokenResponse.md +0 -171
  262. package/data/script-api/dw.customer.oauth.OAuthFinalizedResponse.md +0 -75
  263. package/data/script-api/dw.customer.oauth.OAuthLoginFlowMgr.md +0 -165
  264. package/data/script-api/dw.customer.oauth.OAuthUserInfoResponse.md +0 -84
  265. package/data/script-api/dw.customer.oauth.md +0 -9
  266. package/data/script-api/dw.customer.shoppercontext.ShopperContext.md +0 -369
  267. package/data/script-api/dw.customer.shoppercontext.ShopperContextErrorCodes.md +0 -111
  268. package/data/script-api/dw.customer.shoppercontext.ShopperContextException.md +0 -77
  269. package/data/script-api/dw.customer.shoppercontext.ShopperContextMgr.md +0 -209
  270. package/data/script-api/dw.customer.shoppercontext.md +0 -9
  271. package/data/script-api/dw.experience.AspectAttributeValidationException.md +0 -25
  272. package/data/script-api/dw.experience.Component.md +0 -166
  273. package/data/script-api/dw.experience.ComponentRenderSettings.md +0 -130
  274. package/data/script-api/dw.experience.ComponentScriptContext.md +0 -148
  275. package/data/script-api/dw.experience.CustomEditor.md +0 -146
  276. package/data/script-api/dw.experience.CustomEditorResources.md +0 -100
  277. package/data/script-api/dw.experience.Page.md +0 -467
  278. package/data/script-api/dw.experience.PageMgr.md +0 -549
  279. package/data/script-api/dw.experience.PageScriptContext.md +0 -200
  280. package/data/script-api/dw.experience.Region.md +0 -119
  281. package/data/script-api/dw.experience.RegionRenderSettings.md +0 -207
  282. package/data/script-api/dw.experience.cms.CMSRecord.md +0 -125
  283. package/data/script-api/dw.experience.cms.md +0 -6
  284. package/data/script-api/dw.experience.image.FocalPoint.md +0 -71
  285. package/data/script-api/dw.experience.image.Image.md +0 -101
  286. package/data/script-api/dw.experience.image.ImageMetaData.md +0 -71
  287. package/data/script-api/dw.experience.image.md +0 -8
  288. package/data/script-api/dw.experience.md +0 -16
  289. package/data/script-api/dw.extensions.applepay.ApplePayHookResult.md +0 -254
  290. package/data/script-api/dw.extensions.applepay.ApplePayHooks.md +0 -572
  291. package/data/script-api/dw.extensions.applepay.md +0 -7
  292. package/data/script-api/dw.extensions.facebook.FacebookFeedHooks.md +0 -102
  293. package/data/script-api/dw.extensions.facebook.FacebookProduct.md +0 -1343
  294. package/data/script-api/dw.extensions.facebook.md +0 -7
  295. package/data/script-api/dw.extensions.paymentapi.PaymentApiHooks.md +0 -136
  296. package/data/script-api/dw.extensions.paymentapi.md +0 -6
  297. package/data/script-api/dw.extensions.paymentrequest.PaymentRequestHookResult.md +0 -149
  298. package/data/script-api/dw.extensions.paymentrequest.PaymentRequestHooks.md +0 -356
  299. package/data/script-api/dw.extensions.paymentrequest.md +0 -7
  300. package/data/script-api/dw.extensions.payments.SalesforceAdyenPaymentIntent.md +0 -134
  301. package/data/script-api/dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md +0 -283
  302. package/data/script-api/dw.extensions.payments.SalesforceBancontactPaymentDetails.md +0 -88
  303. package/data/script-api/dw.extensions.payments.SalesforceCardPaymentDetails.md +0 -107
  304. package/data/script-api/dw.extensions.payments.SalesforceEpsPaymentDetails.md +0 -63
  305. package/data/script-api/dw.extensions.payments.SalesforceIdealPaymentDetails.md +0 -63
  306. package/data/script-api/dw.extensions.payments.SalesforceKlarnaPaymentDetails.md +0 -63
  307. package/data/script-api/dw.extensions.payments.SalesforcePayPalOrder.md +0 -263
  308. package/data/script-api/dw.extensions.payments.SalesforcePayPalOrderAddress.md +0 -171
  309. package/data/script-api/dw.extensions.payments.SalesforcePayPalOrderPayer.md +0 -110
  310. package/data/script-api/dw.extensions.payments.SalesforcePayPalPaymentDetails.md +0 -88
  311. package/data/script-api/dw.extensions.payments.SalesforcePaymentDetails.md +0 -83
  312. package/data/script-api/dw.extensions.payments.SalesforcePaymentIntent.md +0 -273
  313. package/data/script-api/dw.extensions.payments.SalesforcePaymentMethod.md +0 -368
  314. package/data/script-api/dw.extensions.payments.SalesforcePaymentRequest.md +0 -1077
  315. package/data/script-api/dw.extensions.payments.SalesforcePaymentsHooks.md +0 -190
  316. package/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccount.md +0 -151
  317. package/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md +0 -98
  318. package/data/script-api/dw.extensions.payments.SalesforcePaymentsMgr.md +0 -989
  319. package/data/script-api/dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md +0 -202
  320. package/data/script-api/dw.extensions.payments.SalesforcePaymentsZone.md +0 -393
  321. package/data/script-api/dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md +0 -63
  322. package/data/script-api/dw.extensions.payments.SalesforceVenmoPaymentDetails.md +0 -88
  323. package/data/script-api/dw.extensions.payments.md +0 -28
  324. package/data/script-api/dw.extensions.pinterest.PinterestAvailability.md +0 -85
  325. package/data/script-api/dw.extensions.pinterest.PinterestFeedHooks.md +0 -118
  326. package/data/script-api/dw.extensions.pinterest.PinterestOrder.md +0 -263
  327. package/data/script-api/dw.extensions.pinterest.PinterestOrderHooks.md +0 -89
  328. package/data/script-api/dw.extensions.pinterest.PinterestProduct.md +0 -677
  329. package/data/script-api/dw.extensions.pinterest.md +0 -10
  330. package/data/script-api/dw.io.CSVStreamReader.md +0 -128
  331. package/data/script-api/dw.io.CSVStreamWriter.md +0 -92
  332. package/data/script-api/dw.io.File.md +0 -729
  333. package/data/script-api/dw.io.FileReader.md +0 -70
  334. package/data/script-api/dw.io.FileWriter.md +0 -159
  335. package/data/script-api/dw.io.InputStream.md +0 -35
  336. package/data/script-api/dw.io.OutputStream.md +0 -38
  337. package/data/script-api/dw.io.PrintWriter.md +0 -66
  338. package/data/script-api/dw.io.RandomAccessFileReader.md +0 -183
  339. package/data/script-api/dw.io.Reader.md +0 -284
  340. package/data/script-api/dw.io.StringWriter.md +0 -89
  341. package/data/script-api/dw.io.Writer.md +0 -96
  342. package/data/script-api/dw.io.XMLIndentingStreamWriter.md +0 -121
  343. package/data/script-api/dw.io.XMLStreamConstants.md +0 -172
  344. package/data/script-api/dw.io.XMLStreamReader.md +0 -1181
  345. package/data/script-api/dw.io.XMLStreamWriter.md +0 -478
  346. package/data/script-api/dw.io.md +0 -21
  347. package/data/script-api/dw.job.JobExecution.md +0 -111
  348. package/data/script-api/dw.job.JobStepExecution.md +0 -136
  349. package/data/script-api/dw.job.md +0 -7
  350. package/data/script-api/dw.net.FTPClient.md +0 -621
  351. package/data/script-api/dw.net.FTPFileInfo.md +0 -132
  352. package/data/script-api/dw.net.HTTPClient.md +0 -775
  353. package/data/script-api/dw.net.HTTPClientLoggingConfig.md +0 -363
  354. package/data/script-api/dw.net.HTTPRequestPart.md +0 -296
  355. package/data/script-api/dw.net.Mail.md +0 -487
  356. package/data/script-api/dw.net.SFTPClient.md +0 -535
  357. package/data/script-api/dw.net.SFTPFileInfo.md +0 -128
  358. package/data/script-api/dw.net.WebDAVClient.md +0 -762
  359. package/data/script-api/dw.net.WebDAVFileInfo.md +0 -163
  360. package/data/script-api/dw.net.md +0 -15
  361. package/data/script-api/dw.object.ActiveData.md +0 -86
  362. package/data/script-api/dw.object.CustomAttributes.md +0 -165
  363. package/data/script-api/dw.object.CustomObject.md +0 -82
  364. package/data/script-api/dw.object.CustomObjectMgr.md +0 -478
  365. package/data/script-api/dw.object.Extensible.md +0 -71
  366. package/data/script-api/dw.object.ExtensibleObject.md +0 -85
  367. package/data/script-api/dw.object.Note.md +0 -118
  368. package/data/script-api/dw.object.ObjectAttributeDefinition.md +0 -542
  369. package/data/script-api/dw.object.ObjectAttributeGroup.md +0 -160
  370. package/data/script-api/dw.object.ObjectAttributeValueDefinition.md +0 -78
  371. package/data/script-api/dw.object.ObjectTypeDefinition.md +0 -239
  372. package/data/script-api/dw.object.PersistentObject.md +0 -92
  373. package/data/script-api/dw.object.SimpleExtensible.md +0 -53
  374. package/data/script-api/dw.object.SystemObjectMgr.md +0 -520
  375. package/data/script-api/dw.object.md +0 -19
  376. package/data/script-api/dw.order.AbstractItem.md +0 -220
  377. package/data/script-api/dw.order.AbstractItemCtnr.md +0 -219
  378. package/data/script-api/dw.order.Appeasement.md +0 -398
  379. package/data/script-api/dw.order.AppeasementItem.md +0 -104
  380. package/data/script-api/dw.order.Basket.md +0 -868
  381. package/data/script-api/dw.order.BasketMgr.md +0 -673
  382. package/data/script-api/dw.order.BonusDiscountLineItem.md +0 -309
  383. package/data/script-api/dw.order.CouponLineItem.md +0 -289
  384. package/data/script-api/dw.order.CreateAgentBasketLimitExceededException.md +0 -35
  385. package/data/script-api/dw.order.CreateBasketFromOrderException.md +0 -54
  386. package/data/script-api/dw.order.CreateCouponLineItemException.md +0 -67
  387. package/data/script-api/dw.order.CreateOrderException.md +0 -23
  388. package/data/script-api/dw.order.CreateTemporaryBasketLimitExceededException.md +0 -35
  389. package/data/script-api/dw.order.GiftCertificate.md +0 -530
  390. package/data/script-api/dw.order.GiftCertificateLineItem.md +0 -292
  391. package/data/script-api/dw.order.GiftCertificateMgr.md +0 -228
  392. package/data/script-api/dw.order.GiftCertificateStatusCodes.md +0 -108
  393. package/data/script-api/dw.order.Invoice.md +0 -571
  394. package/data/script-api/dw.order.InvoiceItem.md +0 -199
  395. package/data/script-api/dw.order.LineItem.md +0 -577
  396. package/data/script-api/dw.order.LineItemCtnr.md +0 -2429
  397. package/data/script-api/dw.order.LineItemTax.md +0 -142
  398. package/data/script-api/dw.order.Order.md +0 -2770
  399. package/data/script-api/dw.order.OrderAddress.md +0 -624
  400. package/data/script-api/dw.order.OrderItem.md +0 -613
  401. package/data/script-api/dw.order.OrderMgr.md +0 -1502
  402. package/data/script-api/dw.order.OrderPaymentInstrument.md +0 -231
  403. package/data/script-api/dw.order.OrderProcessStatusCodes.md +0 -146
  404. package/data/script-api/dw.order.PaymentCard.md +0 -220
  405. package/data/script-api/dw.order.PaymentInstrument.md +0 -1416
  406. package/data/script-api/dw.order.PaymentMethod.md +0 -257
  407. package/data/script-api/dw.order.PaymentMgr.md +0 -138
  408. package/data/script-api/dw.order.PaymentProcessor.md +0 -106
  409. package/data/script-api/dw.order.PaymentStatusCodes.md +0 -70
  410. package/data/script-api/dw.order.PaymentTransaction.md +0 -291
  411. package/data/script-api/dw.order.PriceAdjustment.md +0 -745
  412. package/data/script-api/dw.order.PriceAdjustmentLimitTypes.md +0 -61
  413. package/data/script-api/dw.order.ProductLineItem.md +0 -1749
  414. package/data/script-api/dw.order.ProductShippingCost.md +0 -101
  415. package/data/script-api/dw.order.ProductShippingLineItem.md +0 -336
  416. package/data/script-api/dw.order.ProductShippingModel.md +0 -143
  417. package/data/script-api/dw.order.Return.md +0 -396
  418. package/data/script-api/dw.order.ReturnCase.md +0 -463
  419. package/data/script-api/dw.order.ReturnCaseItem.md +0 -372
  420. package/data/script-api/dw.order.ReturnItem.md +0 -335
  421. package/data/script-api/dw.order.Shipment.md +0 -1132
  422. package/data/script-api/dw.order.ShipmentShippingCost.md +0 -54
  423. package/data/script-api/dw.order.ShipmentShippingModel.md +0 -203
  424. package/data/script-api/dw.order.ShippingLineItem.md +0 -315
  425. package/data/script-api/dw.order.ShippingLocation.md +0 -313
  426. package/data/script-api/dw.order.ShippingMethod.md +0 -251
  427. package/data/script-api/dw.order.ShippingMgr.md +0 -173
  428. package/data/script-api/dw.order.ShippingOrder.md +0 -630
  429. package/data/script-api/dw.order.ShippingOrderItem.md +0 -425
  430. package/data/script-api/dw.order.SumItem.md +0 -158
  431. package/data/script-api/dw.order.TaxGroup.md +0 -128
  432. package/data/script-api/dw.order.TaxItem.md +0 -74
  433. package/data/script-api/dw.order.TaxMgr.md +0 -314
  434. package/data/script-api/dw.order.TrackingInfo.md +0 -261
  435. package/data/script-api/dw.order.TrackingRef.md +0 -108
  436. package/data/script-api/dw.order.hooks.BasketMergeHooks.md +0 -87
  437. package/data/script-api/dw.order.hooks.CalculateHooks.md +0 -139
  438. package/data/script-api/dw.order.hooks.CheckoutHooks.md +0 -88
  439. package/data/script-api/dw.order.hooks.OrderHooks.md +0 -96
  440. package/data/script-api/dw.order.hooks.PaymentHooks.md +0 -325
  441. package/data/script-api/dw.order.hooks.ReturnHooks.md +0 -395
  442. package/data/script-api/dw.order.hooks.ShippingOrderHooks.md +0 -426
  443. package/data/script-api/dw.order.hooks.TaxHooks.md +0 -495
  444. package/data/script-api/dw.order.hooks.md +0 -13
  445. package/data/script-api/dw.order.md +0 -65
  446. package/data/script-api/dw.rpc.SOAPUtil.md +0 -736
  447. package/data/script-api/dw.rpc.Stub.md +0 -373
  448. package/data/script-api/dw.rpc.WebReference.md +0 -133
  449. package/data/script-api/dw.rpc.md +0 -8
  450. package/data/script-api/dw.sitemap.SitemapFile.md +0 -137
  451. package/data/script-api/dw.sitemap.SitemapMgr.md +0 -165
  452. package/data/script-api/dw.sitemap.md +0 -7
  453. package/data/script-api/dw.suggest.BrandSuggestions.md +0 -34
  454. package/data/script-api/dw.suggest.CategorySuggestions.md +0 -76
  455. package/data/script-api/dw.suggest.ContentSuggestions.md +0 -76
  456. package/data/script-api/dw.suggest.CustomSuggestions.md +0 -34
  457. package/data/script-api/dw.suggest.ProductSuggestions.md +0 -76
  458. package/data/script-api/dw.suggest.SearchPhraseSuggestions.md +0 -126
  459. package/data/script-api/dw.suggest.SuggestModel.md +0 -471
  460. package/data/script-api/dw.suggest.SuggestedCategory.md +0 -51
  461. package/data/script-api/dw.suggest.SuggestedContent.md +0 -51
  462. package/data/script-api/dw.suggest.SuggestedPhrase.md +0 -70
  463. package/data/script-api/dw.suggest.SuggestedProduct.md +0 -55
  464. package/data/script-api/dw.suggest.SuggestedTerm.md +0 -143
  465. package/data/script-api/dw.suggest.SuggestedTerms.md +0 -144
  466. package/data/script-api/dw.suggest.Suggestions.md +0 -206
  467. package/data/script-api/dw.suggest.md +0 -19
  468. package/data/script-api/dw.svc.FTPService.md +0 -140
  469. package/data/script-api/dw.svc.FTPServiceDefinition.md +0 -97
  470. package/data/script-api/dw.svc.HTTPFormService.md +0 -32
  471. package/data/script-api/dw.svc.HTTPFormServiceDefinition.md +0 -36
  472. package/data/script-api/dw.svc.HTTPService.md +0 -370
  473. package/data/script-api/dw.svc.HTTPServiceDefinition.md +0 -290
  474. package/data/script-api/dw.svc.LocalServiceRegistry.md +0 -63
  475. package/data/script-api/dw.svc.Result.md +0 -320
  476. package/data/script-api/dw.svc.SOAPService.md +0 -104
  477. package/data/script-api/dw.svc.SOAPServiceDefinition.md +0 -32
  478. package/data/script-api/dw.svc.Service.md +0 -276
  479. package/data/script-api/dw.svc.ServiceCallback.md +0 -282
  480. package/data/script-api/dw.svc.ServiceConfig.md +0 -114
  481. package/data/script-api/dw.svc.ServiceCredential.md +0 -162
  482. package/data/script-api/dw.svc.ServiceDefinition.md +0 -211
  483. package/data/script-api/dw.svc.ServiceProfile.md +0 -152
  484. package/data/script-api/dw.svc.ServiceRegistry.md +0 -118
  485. package/data/script-api/dw.svc.md +0 -22
  486. package/data/script-api/dw.system.AgentUserStatusCodes.md +0 -41
  487. package/data/script-api/dw.system.Cache.md +0 -126
  488. package/data/script-api/dw.system.CacheMgr.md +0 -70
  489. package/data/script-api/dw.system.HookMgr.md +0 -78
  490. package/data/script-api/dw.system.InternalObject.md +0 -47
  491. package/data/script-api/dw.system.JobProcessMonitor.md +0 -103
  492. package/data/script-api/dw.system.Log.md +0 -198
  493. package/data/script-api/dw.system.LogNDC.md +0 -75
  494. package/data/script-api/dw.system.Logger.md +0 -216
  495. package/data/script-api/dw.system.OrganizationPreferences.md +0 -53
  496. package/data/script-api/dw.system.Pipeline.md +0 -94
  497. package/data/script-api/dw.system.PipelineDictionary.md +0 -42
  498. package/data/script-api/dw.system.RESTErrorResponse.md +0 -102
  499. package/data/script-api/dw.system.RESTResponseMgr.md +0 -243
  500. package/data/script-api/dw.system.RESTSuccessResponse.md +0 -62
  501. package/data/script-api/dw.system.RemoteInclude.md +0 -146
  502. package/data/script-api/dw.system.Request.md +0 -785
  503. package/data/script-api/dw.system.RequestHooks.md +0 -112
  504. package/data/script-api/dw.system.Response.md +0 -612
  505. package/data/script-api/dw.system.SearchStatus.md +0 -187
  506. package/data/script-api/dw.system.Session.md +0 -469
  507. package/data/script-api/dw.system.Site.md +0 -570
  508. package/data/script-api/dw.system.SitePreferences.md +0 -90
  509. package/data/script-api/dw.system.Status.md +0 -330
  510. package/data/script-api/dw.system.StatusItem.md +0 -273
  511. package/data/script-api/dw.system.System.md +0 -224
  512. package/data/script-api/dw.system.Transaction.md +0 -107
  513. package/data/script-api/dw.system.md +0 -32
  514. package/data/script-api/dw.template.ISML.md +0 -127
  515. package/data/script-api/dw.template.Velocity.md +0 -168
  516. package/data/script-api/dw.template.md +0 -7
  517. package/data/script-api/dw.util.ArrayList.md +0 -99
  518. package/data/script-api/dw.util.Assert.md +0 -370
  519. package/data/script-api/dw.util.BigInteger.md +0 -283
  520. package/data/script-api/dw.util.Bytes.md +0 -278
  521. package/data/script-api/dw.util.Calendar.md +0 -1051
  522. package/data/script-api/dw.util.Collection.md +0 -272
  523. package/data/script-api/dw.util.Currency.md +0 -147
  524. package/data/script-api/dw.util.DateUtils.md +0 -82
  525. package/data/script-api/dw.util.Decimal.md +0 -386
  526. package/data/script-api/dw.util.FilteringCollection.md +0 -140
  527. package/data/script-api/dw.util.Geolocation.md +0 -293
  528. package/data/script-api/dw.util.HashMap.md +0 -50
  529. package/data/script-api/dw.util.HashSet.md +0 -65
  530. package/data/script-api/dw.util.Iterator.md +0 -86
  531. package/data/script-api/dw.util.LinkedHashMap.md +0 -52
  532. package/data/script-api/dw.util.LinkedHashSet.md +0 -68
  533. package/data/script-api/dw.util.List.md +0 -429
  534. package/data/script-api/dw.util.Locale.md +0 -277
  535. package/data/script-api/dw.util.Map.md +0 -251
  536. package/data/script-api/dw.util.MapEntry.md +0 -68
  537. package/data/script-api/dw.util.MappingKey.md +0 -96
  538. package/data/script-api/dw.util.MappingMgr.md +0 -113
  539. package/data/script-api/dw.util.PropertyComparator.md +0 -122
  540. package/data/script-api/dw.util.SecureEncoder.md +0 -582
  541. package/data/script-api/dw.util.SecureFilter.md +0 -572
  542. package/data/script-api/dw.util.SeekableIterator.md +0 -187
  543. package/data/script-api/dw.util.Set.md +0 -39
  544. package/data/script-api/dw.util.SortedMap.md +0 -148
  545. package/data/script-api/dw.util.SortedSet.md +0 -173
  546. package/data/script-api/dw.util.StringUtils.md +0 -655
  547. package/data/script-api/dw.util.Template.md +0 -141
  548. package/data/script-api/dw.util.UUIDUtils.md +0 -34
  549. package/data/script-api/dw.util.md +0 -37
  550. package/data/script-api/dw.value.EnumValue.md +0 -105
  551. package/data/script-api/dw.value.MimeEncodedText.md +0 -131
  552. package/data/script-api/dw.value.Money.md +0 -526
  553. package/data/script-api/dw.value.Quantity.md +0 -299
  554. package/data/script-api/dw.value.md +0 -9
  555. package/data/script-api/dw.web.CSRFProtection.md +0 -105
  556. package/data/script-api/dw.web.ClickStream.md +0 -177
  557. package/data/script-api/dw.web.ClickStreamEntry.md +0 -255
  558. package/data/script-api/dw.web.Cookie.md +0 -431
  559. package/data/script-api/dw.web.Cookies.md +0 -59
  560. package/data/script-api/dw.web.Form.md +0 -84
  561. package/data/script-api/dw.web.FormAction.md +0 -195
  562. package/data/script-api/dw.web.FormElement.md +0 -211
  563. package/data/script-api/dw.web.FormElementValidationResult.md +0 -170
  564. package/data/script-api/dw.web.FormField.md +0 -642
  565. package/data/script-api/dw.web.FormFieldOption.md +0 -211
  566. package/data/script-api/dw.web.FormFieldOptions.md +0 -49
  567. package/data/script-api/dw.web.FormGroup.md +0 -222
  568. package/data/script-api/dw.web.FormList.md +0 -134
  569. package/data/script-api/dw.web.FormListItem.md +0 -57
  570. package/data/script-api/dw.web.Forms.md +0 -25
  571. package/data/script-api/dw.web.HttpParameter.md +0 -462
  572. package/data/script-api/dw.web.HttpParameterMap.md +0 -194
  573. package/data/script-api/dw.web.LoopIterator.md +0 -231
  574. package/data/script-api/dw.web.PageMetaData.md +0 -197
  575. package/data/script-api/dw.web.PageMetaTag.md +0 -173
  576. package/data/script-api/dw.web.PagingModel.md +0 -407
  577. package/data/script-api/dw.web.Resource.md +0 -147
  578. package/data/script-api/dw.web.URL.md +0 -174
  579. package/data/script-api/dw.web.URLAction.md +0 -95
  580. package/data/script-api/dw.web.URLParameter.md +0 -52
  581. package/data/script-api/dw.web.URLRedirect.md +0 -72
  582. package/data/script-api/dw.web.URLRedirectMgr.md +0 -86
  583. package/data/script-api/dw.web.URLUtils.md +0 -1357
  584. package/data/script-api/dw.web.md +0 -34
  585. package/data/script-api/dw.ws.Port.md +0 -126
  586. package/data/script-api/dw.ws.WSUtil.md +0 -728
  587. package/data/script-api/dw.ws.WebReference2.md +0 -137
  588. package/data/script-api/dw.ws.md +0 -8
  589. package/data/script-api/index.md +0 -40
@@ -1,1234 +0,0 @@
1
- <!-- prettier-ignore-start -->
2
- # Class Cipher
3
-
4
- - [TopLevel.Object](TopLevel.Object.md)
5
- - [dw.crypto.Cipher](dw.crypto.Cipher.md)
6
-
7
- This class allows access to encryption services offered through the Java
8
- Cryptography Architecture (JCA). At this time the implementation of the
9
- encryption/decryption methods is based on the default JCE provider of the JDK.
10
- See the Java documentation for a reference guide to the underlying security
11
- provider and information about the Secure Sockets Extension.
12
-
13
- You can find a good overview of the essential purposes of cryptography and
14
- some common implementations in the Wikipedia article on cryptography.
15
- Also see the website of the National Institute of Standards and Technology.
16
- The format of various files used to hold keys, certificate signing requests,
17
- and the like, as well as some related algorithms, are defined in the PKCS series of
18
- documents published by RSALabs (the research arm of RSA Security).
19
-
20
- Many internet standards documenting security protocols and concepts are described
21
- in documents originally described as "Request For Comment" and thus widely known
22
- as RFCs. Many of them are available on the Internet FAQ Archives website.
23
-
24
-
25
- dw.crypto.Cipher is intentionally an Adapter to the full cryptography power supplied
26
- in the security provider implementation.
27
-
28
-
29
- **Note:** this class handles sensitive security-related data.
30
- Pay special attention to PCI DSS v3 requirements 2, 4, and 12.
31
-
32
-
33
-
34
- ## Constant Summary
35
-
36
- | Constant | Description |
37
- | --- | --- |
38
- | [CHAR_ENCODING](#char_encoding): [String](TopLevel.String.md) = "UTF8" | Strings containing keys, plain texts, cipher texts etc. |
39
-
40
- ## Constructor Summary
41
-
42
- | Constructor | Description |
43
- | --- | --- |
44
- | [Cipher](#cipher)() | |
45
-
46
- ## Method Summary
47
-
48
- | Method | Description |
49
- | --- | --- |
50
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the decryption. |
51
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. |
52
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the decryption. |
53
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. |
54
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the decryption. |
55
- | [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. |
56
- | [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-1)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1), which allows to use a key in the keystore for the decryption. |
57
- | [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. |
58
- | [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-2)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2), which allows to use a key in the keystore for the decryption. |
59
- | [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. |
60
- | [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-3)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3), which allows to use a key in the keystore for the decryption. |
61
- | [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. |
62
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the encryption. |
63
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. |
64
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the encryption. |
65
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. |
66
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the encryption. |
67
- | [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. |
68
- | [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-1)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1), which allows you to use a key in the keystore for encryption. |
69
- | [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. |
70
- | [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-2)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2), which allows you to use a key in the keystore for encryption. |
71
- | [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. |
72
- | [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-3)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3), which allows you to use a key in the keystore for encryption. |
73
- | [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. |
74
-
75
- ### Methods inherited from class Object
76
-
77
- [assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject)
78
- ## Constant Details
79
-
80
- ### CHAR_ENCODING
81
-
82
- - CHAR_ENCODING: [String](TopLevel.String.md) = "UTF8"
83
- - : Strings containing keys, plain texts, cipher texts etc. are internally
84
- converted into byte arrays using this encoding (currently UTF8).
85
-
86
-
87
-
88
- ---
89
-
90
- ## Constructor Details
91
-
92
- ### Cipher()
93
- - Cipher()
94
- - :
95
-
96
-
97
- ---
98
-
99
- ## Method Details
100
-
101
- ### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 1
102
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
103
- - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows
104
- to use a key in the keystore for the decryption.
105
-
106
-
107
- **Parameters:**
108
- - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1))
109
- - privateKey - A reference to a private key in the key store.
110
- - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1))
111
- - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1))
112
- - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1))
113
-
114
- **Returns:**
115
- - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1))
116
-
117
- **API Version:**
118
- :::note
119
- No longer available as of version 15.5.
120
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
121
- :::
122
-
123
- ---
124
-
125
- ### decryptBytes(Bytes, String, String, String, Number) - Variant 1
126
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
127
- - : Lower-level decryption API. Decrypts the passed bytes using the specified
128
- key and applying the transformations described by the specified
129
- parameters.
130
-
131
-
132
- Typical usage:
133
-
134
-
135
- ```
136
- var base64Msg : String = "some_encoded_encrypted_message";
137
- var charset : String = "UTF8"; // or "windows-1252", etc.
138
-
139
- var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg);
140
- var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations);
141
- var message : String = messageBytes.toString(charset);
142
- ```
143
-
144
-
145
- **Parameters:**
146
- - encryptedBytes - The bytes to decrypt.
147
- - key - The key to use for decryption.
148
- - transformation - The transformation used to originally encrypt.
149
- - saltOrIV - the salt or IV to use.
150
- - iterations - the iterations to use.
151
-
152
- **Returns:**
153
- - The decrypted bytes.
154
-
155
- **See Also:**
156
- - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)
157
-
158
- **API Version:**
159
- :::note
160
- No longer available as of version 15.5.
161
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
162
- :::
163
-
164
- ---
165
-
166
- ### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 2
167
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
168
- - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows
169
- to use a key in the keystore for the decryption.
170
-
171
-
172
- **Parameters:**
173
- - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2))
174
- - privateKey - A reference to a private key in the key store.
175
- - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2))
176
- - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2))
177
- - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2))
178
-
179
- **Returns:**
180
- - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2))
181
-
182
- **API Version:**
183
- :::note
184
- Available from version 15.5.
185
- No longer available as of version 16.2.
186
- Requires Base64-encryption for the salt parameter.
187
- :::
188
-
189
- ---
190
-
191
- ### decryptBytes(Bytes, String, String, String, Number) - Variant 2
192
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
193
- - : Lower-level decryption API. Decrypts the passed bytes using the specified
194
- key and applying the transformations described by the specified
195
- parameters.
196
-
197
-
198
- Typical usage:
199
-
200
-
201
- ```
202
- var base64Msg : String = "some_encoded_encrypted_message";
203
- var charset : String = "UTF8"; // or "windows-1252", etc.
204
-
205
- var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg);
206
- var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations);
207
- var message : String = messageBytes.toString(charset);
208
- ```
209
-
210
-
211
- **Parameters:**
212
- - encryptedBytes - The bytes to decrypt.
213
- - key - The key to use for decryption.
214
- - transformation - The transformation used to originally encrypt.
215
- - saltOrIV - the salt or IV to use.
216
- - iterations - the iterations to use.
217
-
218
- **Returns:**
219
- - The decrypted bytes.
220
-
221
- **See Also:**
222
- - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)
223
-
224
- **API Version:**
225
- :::note
226
- Available from version 15.5.
227
- No longer available as of version 16.2.
228
- Requires Base64-encryption for the salt parameter.
229
- :::
230
-
231
- ---
232
-
233
- ### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 3
234
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
235
- - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows
236
- to use a key in the keystore for the decryption.
237
-
238
-
239
- **Parameters:**
240
- - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3))
241
- - privateKey - A reference to a private key in the key store.
242
- - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3))
243
- - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3))
244
- - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3))
245
-
246
- **Returns:**
247
- - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3))
248
-
249
- **API Version:**
250
- :::note
251
- Available from version 16.2.
252
- Does not use a default initialization vector.
253
- :::
254
-
255
- ---
256
-
257
- ### decryptBytes(Bytes, String, String, String, Number) - Variant 3
258
- - decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
259
- - : Lower-level decryption API. Decrypts the passed bytes using the specified
260
- key and applying the transformations described by the specified
261
- parameters.
262
-
263
-
264
- Typical usage:
265
-
266
-
267
- ```
268
- var base64Msg : String = "some_encoded_encrypted_message";
269
- var charset : String = "UTF8"; // or "windows-1252", etc.
270
-
271
- var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg);
272
- var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations);
273
- var message : String = messageBytes.toString(charset);
274
- ```
275
-
276
-
277
- **Parameters:**
278
- - encryptedBytes - The bytes to decrypt.
279
- - key - The key to use for decryption.
280
- - transformation - The transformation used to originally encrypt.
281
- - saltOrIV - the salt or IV to use.
282
- - iterations - the iterations to use.
283
-
284
- **Returns:**
285
- - The decrypted bytes.
286
-
287
- **See Also:**
288
- - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)
289
-
290
- **API Version:**
291
- :::note
292
- Available from version 16.2.
293
- Does not use a default initialization vector.
294
- :::
295
-
296
- ---
297
-
298
- ### decrypt(String, KeyRef, String, String, Number) - Variant 1
299
- - decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
300
- - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1), which allows
301
- to use a key in the keystore for the decryption.
302
-
303
-
304
-
305
- Note: Only asymmetric (public/private key pair) algorithms can be used
306
- with this method, since only those keys can be added to a keystore.
307
-
308
-
309
- **Parameters:**
310
- - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1))
311
- - privateKey - A reference to a private key in the key store.
312
- - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1))
313
- - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1))
314
- - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1))
315
-
316
- **Returns:**
317
- - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1))
318
-
319
- **API Version:**
320
- :::note
321
- No longer available as of version 15.5.
322
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
323
- :::
324
-
325
- ---
326
-
327
- ### decrypt(String, String, String, String, Number) - Variant 1
328
- - decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
329
- - : Decrypts the passed Base-64 encoded message using the passed key and
330
- applying the transformations described by the passed parameters.
331
-
332
-
333
- Decryption is the process of getting back the original data from the
334
- cipher-text using a decryption key.
335
-
336
-
337
- **Parameters:**
338
- - base64Msg - the base64 encoded cipher bytes
339
- - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). Note that for RSA the key length should be at least 2048 bits.
340
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations.
341
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value.
342
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data.
343
-
344
- **Returns:**
345
- - the original plaintext message.
346
-
347
- **API Version:**
348
- :::note
349
- No longer available as of version 15.5.
350
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
351
- :::
352
-
353
- ---
354
-
355
- ### decrypt(String, KeyRef, String, String, Number) - Variant 2
356
- - decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
357
- - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2), which allows
358
- to use a key in the keystore for the decryption.
359
-
360
-
361
-
362
- Note: Only asymmetric (public/private key pair) algorithms can be used
363
- with this method, since only those keys can be added to a keystore.
364
-
365
-
366
- **Parameters:**
367
- - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2))
368
- - privateKey - A reference to a private key in the key store.
369
- - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2))
370
- - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2))
371
- - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2))
372
-
373
- **Returns:**
374
- - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2))
375
-
376
- **API Version:**
377
- :::note
378
- Available from version 15.5.
379
- No longer available as of version 16.2.
380
- Requires Base64-encryption for the salt parameter.
381
- :::
382
-
383
- ---
384
-
385
- ### decrypt(String, String, String, String, Number) - Variant 2
386
- - decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
387
- - : Decrypts the passed Base-64 encoded message using the passed key and
388
- applying the transformations described by the passed parameters.
389
-
390
-
391
- Decryption is the process of getting back the original data from the
392
- cipher-text using a decryption key.
393
-
394
-
395
- **Parameters:**
396
- - base64Msg - the base64 encoded cipher bytes
397
- - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding).
398
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations.
399
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value.
400
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data.
401
-
402
- **Returns:**
403
- - the original plaintext message.
404
-
405
- **API Version:**
406
- :::note
407
- Available from version 15.5.
408
- No longer available as of version 16.2.
409
- Requires Base64-encryption for the salt parameter.
410
- :::
411
-
412
- ---
413
-
414
- ### decrypt(String, KeyRef, String, String, Number) - Variant 3
415
- - decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
416
- - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3), which allows
417
- to use a key in the keystore for the decryption.
418
-
419
-
420
-
421
- Note: Only asymmetric (public/private key pair) algorithms can be used
422
- with this method, since only those keys can be added to a keystore.
423
-
424
-
425
- **Parameters:**
426
- - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3))
427
- - privateKey - A reference to a private key in the key store.
428
- - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3))
429
- - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3))
430
- - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3))
431
-
432
- **Returns:**
433
- - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3))
434
-
435
- **API Version:**
436
- :::note
437
- Available from version 16.2.
438
- Does not use a default initialization vector.
439
- :::
440
-
441
- ---
442
-
443
- ### decrypt(String, String, String, String, Number) - Variant 3
444
- - decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
445
- - : Decrypts the passed Base-64 encoded message using the passed key and
446
- applying the transformations described by the passed parameters.
447
-
448
-
449
- Decryption is the process of getting back the original data from the
450
- cipher-text using a decryption key.
451
-
452
-
453
- **Parameters:**
454
- - base64Msg - the base64 encoded cipher bytes
455
- - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding).
456
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations.
457
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value.
458
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data.
459
-
460
- **Returns:**
461
- - the original plaintext message.
462
-
463
- **API Version:**
464
- :::note
465
- Available from version 16.2.
466
- Does not use a default initialization vector.
467
- :::
468
-
469
- ---
470
-
471
- ### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 1
472
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
473
- - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows
474
- to use a key in the keystore for the encryption.
475
-
476
-
477
-
478
- Note: Only asymmetric (public/private key pair) algorithms can be used
479
- with this method, since only those keys can be added to a keystore.
480
-
481
-
482
- **Parameters:**
483
- - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1))
484
- - publicKey - A reference to a public key.
485
- - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1))
486
- - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1))
487
- - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1))
488
-
489
- **Returns:**
490
- - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1))
491
-
492
- **API Version:**
493
- :::note
494
- No longer available as of version 15.5.
495
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
496
- :::
497
-
498
- ---
499
-
500
- ### encryptBytes(Bytes, String, String, String, Number) - Variant 1
501
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
502
- - : Lower-level encryption API. Encrypts the passed bytes by using the
503
- specified key and applying the transformations described by the specified
504
- parameters.
505
-
506
-
507
- Typical usage:
508
-
509
-
510
- ```
511
- var message : String = "some_message";
512
- var charset : String = "UTF8"; // or "windows-1252", etc.
513
-
514
- // encrypt the message
515
- var messageBytes : Bytes = new Bytes(message, charset);
516
- var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations);
517
- var encrypted : String = Encoding.toBase64(encryptedBytes);
518
- ```
519
-
520
-
521
- **Parameters:**
522
- - messageBytes - The bytes to encrypt.
523
- - key - The key to use for encryption.
524
- - transformation - The transformation to apply.
525
- - saltOrIV - Initialization value appropriate for the algorithm.
526
- - iterations - The number of passes to make when turning a passphrase into a key.
527
-
528
- **Returns:**
529
- - the encrypted bytes.
530
-
531
- **See Also:**
532
- - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)
533
-
534
- **API Version:**
535
- :::note
536
- No longer available as of version 15.5.
537
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
538
- :::
539
-
540
- ---
541
-
542
- ### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 2
543
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
544
- - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows
545
- to use a key in the keystore for the encryption.
546
-
547
-
548
-
549
- Note: Only asymmetric (public/private key pair) algorithms can be used
550
- with this method, since only those keys can be added to a keystore.
551
-
552
-
553
- **Parameters:**
554
- - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2))
555
- - publicKey - A reference to a public key.
556
- - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2))
557
- - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2))
558
- - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2))
559
-
560
- **Returns:**
561
- - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2))
562
-
563
- **API Version:**
564
- :::note
565
- Available from version 15.5.
566
- No longer available as of version 16.2.
567
- Requires Base64-encryption for the salt parameter.
568
- :::
569
-
570
- ---
571
-
572
- ### encryptBytes(Bytes, String, String, String, Number) - Variant 2
573
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
574
- - : Lower-level encryption API. Encrypts the passed bytes by using the
575
- specified key and applying the transformations described by the specified
576
- parameters.
577
-
578
-
579
- Typical usage:
580
-
581
-
582
- ```
583
- var message : String = "some_message";
584
- var charset : String = "UTF8"; // or "windows-1252", etc.
585
-
586
- // encrypt the message
587
- var messageBytes : Bytes = new Bytes(message, charset);
588
- var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations);
589
- var encrypted : String = Encoding.toBase64(encryptedBytes);
590
- ```
591
-
592
-
593
- **Parameters:**
594
- - messageBytes - The bytes to encrypt.
595
- - key - The key to use for encryption.
596
- - transformation - The transformation to apply.
597
- - saltOrIV - Initialization value appropriate for the algorithm.
598
- - iterations - The number of passes to make when turning a passphrase into a key.
599
-
600
- **Returns:**
601
- - the encrypted bytes.
602
-
603
- **See Also:**
604
- - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)
605
-
606
- **API Version:**
607
- :::note
608
- Available from version 15.5.
609
- No longer available as of version 16.2.
610
- Requires Base64-encryption for the salt parameter.
611
- :::
612
-
613
- ---
614
-
615
- ### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 3
616
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
617
- - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows
618
- to use a key in the keystore for the encryption.
619
-
620
-
621
-
622
- Note: Only asymmetric (public/private key pair) algorithms can be used
623
- with this method, since only those keys can be added to a keystore.
624
-
625
-
626
- **Parameters:**
627
- - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3))
628
- - publicKey - A reference to a public key.
629
- - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3))
630
- - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3))
631
- - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3))
632
-
633
- **Returns:**
634
- - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3))
635
-
636
- **API Version:**
637
- :::note
638
- Available from version 16.2.
639
- Does not use a default initialization vector.
640
- :::
641
-
642
- ---
643
-
644
- ### encryptBytes(Bytes, String, String, String, Number) - Variant 3
645
- - encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md)
646
- - : Lower-level encryption API. Encrypts the passed bytes by using the
647
- specified key and applying the transformations described by the specified
648
- parameters.
649
-
650
-
651
- Typical usage:
652
-
653
-
654
- ```
655
- var message : String = "some_message";
656
- var charset : String = "UTF8"; // or "windows-1252", etc.
657
-
658
- // encrypt the message
659
- var messageBytes : Bytes = new Bytes(message, charset);
660
- var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations);
661
- var encrypted : String = Encoding.toBase64(encryptedBytes);
662
- ```
663
-
664
-
665
- **Parameters:**
666
- - messageBytes - The bytes to encrypt.
667
- - key - The key to use for encryption.
668
- - transformation - The transformation to apply.
669
- - saltOrIV - Initialization value appropriate for the algorithm.
670
- - iterations - The number of passes to make when turning a passphrase into a key.
671
-
672
- **Returns:**
673
- - the encrypted bytes.
674
-
675
- **See Also:**
676
- - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)
677
-
678
- **API Version:**
679
- :::note
680
- Available from version 16.2.
681
- Does not use a default initialization vector.
682
- :::
683
-
684
- ---
685
-
686
- ### encrypt(String, CertificateRef, String, String, Number) - Variant 1
687
- - encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
688
- - : Alternative method to
689
- [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1), which allows you to
690
- use a key in the keystore for encryption.
691
-
692
-
693
- Note: Only asymmetric (public/private key pair) algorithms can be used
694
- with this method, since only those keys can be added to a keystore.
695
-
696
-
697
- For asymmetric algorithms a private/public key pair is required.
698
- Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx.
699
- You can assign private keys an extra password in Business Manager. Public keys
700
- can only be imported as trusted certificates in the format \*.crt, \*.pem,
701
- \*.der, and \*.cer.
702
-
703
-
704
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
705
- One of the most popular options is the open source tool OpenSSL.
706
- OpenSSL has a command-line syntax and is available on major platforms.
707
-
708
-
709
- The following steps are involved in **creating an RSA key pair:**
710
-
711
- 1. Generate a public and a non-protected private key ( \*.crt and \*.key ).
712
-
713
-
714
- **Parameters:**
715
- - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1))
716
- - publicKey - A reference to a public key.
717
- - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1))
718
- - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1))
719
- - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1))
720
-
721
- **Returns:**
722
- - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1))
723
-
724
- **API Version:**
725
- :::note
726
- No longer available as of version 15.5.
727
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
728
- :::
729
-
730
- ---
731
-
732
- ### encrypt(String, String, String, String, Number) - Variant 1
733
- - encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
734
- - : Encrypt the passed message by using the specified key and applying the
735
- transformations described by the specified parameters.
736
-
737
-
738
- Encryption is the process of converting normal data or plain text to
739
- something incomprehensible or cipher-text by applying transformations,
740
- which are the operation (or set of operations) to be performed on given input
741
- to produce some output. A transformation always includes the name of a
742
- cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme.
743
- The supported algorithms are listed in the parameter description below.
744
-
745
-
746
- The cryptographic algorithms can be partitioned into _symmetric_
747
- and _asymmetric_ (or public key/private key).
748
-
749
-
750
- **Symmetric** or "secret key" algorithms use the same key to encrypt
751
- and to decrypt the data. Symmetric algorithms are what most people think
752
- of as codes: using a well-known algorithm and a secret key to encode information,
753
- which can be decoded using the same algorithm and the same key. The algorithm
754
- is not secret, the secrecy is inherent to guarding the key. A significant
755
- problem with symmetric ciphers is that it is difficult to transfer the keys
756
- themselves securely. Symmetric algorithms include _password-based_ algorithms.
757
-
758
-
759
- **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward.
760
- Please consider switching to it if you are using any other scheme or if using AES with a
761
- shorter key length. The rest of the symmetric algorithms will be deprecated in the future.**
762
-
763
-
764
- **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key.
765
- Only the holder of the private key will be able to decrypt.
766
- The public key and private key together are also called a "key pair".
767
- Data encrypted with one key can only be decrypted using the other key
768
- from the pair, and it is not possible to deduce one key from the other.
769
- This helps to solve the key distribution problem since it is possible to
770
- publicise one of the keys widely (the "public key") and keep the other
771
- a closely guarded secret (the "private key"). Many partners can then
772
- send data encrypted with the public key, but only the holder of the
773
- corresponding private key can decrypt it.
774
-
775
-
776
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
777
- One of the most popular options is the open source tool OpenSSL.
778
- OpenSSL has a command-line syntax and is available on major platforms.
779
-
780
-
781
- The following steps are involved in **creating an RSA key pair:**
782
-
783
- 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place.
784
-
785
- ```
786
- openssl genrsa -out rsaprivatekey.pem 2048
787
- ```
788
-
789
- 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
790
-
791
- ```
792
- openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout
793
- ```
794
-
795
- 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
796
-
797
- ```
798
- openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt
799
- ```
800
-
801
-
802
-
803
-
804
- **Modes**
805
-
806
- The following modes of operation are block cipher operations that
807
- are used with some algorithms.
808
-
809
- - "NONE" no mode
810
- - "CBC" Cipher Block Chaining (defined in FIPS PUB 81)
811
- - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81)
812
- - "CTS" CipherText Streaming mode
813
- - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81)
814
- - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980.
815
- - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81)
816
- - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4)
817
-
818
-
819
-
820
- **Paddings**
821
-
822
- - "NoPadding": No padding.
823
- - OAEPWith<digest>And<mgf>Padding:
824
- Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where <digest>should be replaced by the message digest and <mgf>by the mask generation function.
825
- Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING
826
- - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme
827
- - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes.
828
- - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993.
829
- - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher)
830
-
831
-
832
- **Parameters:**
833
- - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream)
834
- - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding).
835
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include: <li>"AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding" </li> </ul> Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. Also, PKCS5Padding is the only supported Padding. NOPADDING and ISO10126PADDING have been deprecated. Supported Asymmetric transformations include: <li>"RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING" </li> </ul> Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING,OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING.
836
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1.
837
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data.
838
-
839
- **Returns:**
840
- - the encrypted message encoded as a String using base 64 encoding.
841
-
842
- **API Version:**
843
- :::note
844
- No longer available as of version 15.5.
845
- Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter.
846
- :::
847
-
848
- ---
849
-
850
- ### encrypt(String, CertificateRef, String, String, Number) - Variant 2
851
- - encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
852
- - : Alternative method to
853
- [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2), which allows you to
854
- use a key in the keystore for encryption.
855
-
856
-
857
- Note: Only asymmetric (public/private key pair) algorithms can be used
858
- with this method, since only those keys can be added to a keystore.
859
-
860
-
861
- For asymmetric algorithms a private/public key pair is required.
862
- Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx.
863
- You can assign private keys an extra password in Business Manager. Public keys
864
- can only be imported as trusted certificates in the format \*.crt, \*.pem,
865
- \*.der, and \*.cer.
866
-
867
-
868
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
869
- One of the most popular options is the open source tool OpenSSL.
870
- OpenSSL has a command-line syntax and is available on major platforms.
871
-
872
-
873
- The following steps are involved in **creating an RSA key pair:**
874
-
875
- 1. Generate a public and a non-protected private key ( \*.crt and \*.key ).
876
-
877
- ```
878
- openssl req -x509 -newkey rsa:2048 -keyout nopass.key -out nopass.crt -days 365 -nodes
879
- ```
880
-
881
- 2. Generate a keystore that contains the public and private keys ( \*.p12 ).
882
-
883
- ```
884
- openssl pkcs12 -export -out nopass.p12 -inkey nopass.key -in nopass.crt
885
- ```
886
-
887
-
888
- To import a private or public key into the Digital keystore, navigate to
889
- **Administration > Operations > Private Keys and Certificates**
890
- Use a .p12 file to import a private key and a \*.crt to import a public key.
891
-
892
-
893
- Typical usage:
894
-
895
-
896
- ```
897
- var plain : String = "some_plain_text";
898
- var publicKeyRef = new CertificateRef("rsa-certificate-2048");
899
- var cipher : Cipher = new Cipher();
900
- var encrypted : String = cipher.encrypt(plain, publicKeyRef, "RSA", null, 0);
901
- ```
902
-
903
-
904
- **Parameters:**
905
- - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2))
906
- - publicKey - A reference to a public key.
907
- - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2))
908
- - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2))
909
- - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2))
910
-
911
- **Returns:**
912
- - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2))
913
-
914
- **API Version:**
915
- :::note
916
- Available from version 15.5.
917
- No longer available as of version 16.2.
918
- Requires Base64-encryption for the salt parameter.
919
- :::
920
-
921
- ---
922
-
923
- ### encrypt(String, String, String, String, Number) - Variant 2
924
- - encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
925
- - : Encrypt the passed message by using the specified key and applying the
926
- transformations described by the specified parameters.
927
-
928
-
929
- Encryption is the process of converting normal data or plain text to
930
- something incomprehensible or cipher-text by applying transformations,
931
- which are the operation (or set of operations) to be performed on given input
932
- to produce some output. A transformation always includes the name of a
933
- cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme.
934
- The supported algorithms are listed in the parameter description below.
935
-
936
- The cryptographic algorithms can be partitioned into _symmetric_
937
- and _asymmetric_ (or public key/private key).
938
-
939
-
940
- **Symmetric** or "secret key" algorithms use the same key to encrypt
941
- and to decrypt the data. Symmetric algorithms are what most people think
942
- of as codes: using a well-known algorithm and a secret key to encode information,
943
- which can be decoded using the same algorithm and the same key. The algorithm
944
- is not secret, the secrecy is inherent to guarding the key. A significant
945
- problem with symmetric ciphers is that it is difficult to transfer the keys
946
- themselves securely. Symmetric algorithms include _password-based_ algorithms.
947
-
948
-
949
- **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward.
950
- Please consider switching to it if you are using any other scheme or if using AES with a
951
- shorter key length. The rest of the symmetric algorithms will be deprecated in the future.**
952
-
953
-
954
- **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key.
955
- Only the holder of the private key will be able to decrypt.
956
- The public key and private key together are also called a "key pair".
957
- Data encrypted with one key can only be decrypted using the other key
958
- from the pair, and it is not possible to deduce one key from the other.
959
- This helps to solve the key distribution problem since it is possible to
960
- publicise one of the keys widely (the "public key") and keep the other
961
- a closely guarded secret (the "private key"). Many partners can then
962
- send data encrypted with the public key, but only the holder of the
963
- corresponding private key can decrypt it.
964
-
965
-
966
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
967
- One of the most popular options is the open source tool OpenSSL.
968
- OpenSSL has a command-line syntax and is available on major platforms.
969
-
970
-
971
- The following steps are involved in **creating an RSA key pair:**
972
-
973
- 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place.
974
-
975
- ```
976
- openssl genrsa -out rsaprivatekey.pem 2048
977
- ```
978
-
979
- 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
980
-
981
- ```
982
- openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout
983
- ```
984
-
985
- 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
986
-
987
- ```
988
- openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt
989
- ```
990
-
991
-
992
-
993
-
994
- **Modes**
995
-
996
- The following modes of operation are block cipher operations that
997
- are used with some algorithms.
998
-
999
- - "NONE" no mode
1000
- - "CBC" Cipher Block Chaining (defined in FIPS PUB 81)
1001
- - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81)
1002
- - "CTS" CipherText Streaming mode
1003
- - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81)
1004
- - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980.
1005
- - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81)
1006
- - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4)
1007
-
1008
-
1009
-
1010
- **Paddings**
1011
-
1012
- - "NoPadding": No padding.
1013
- - OAEPWith<digest>And<mgf>Padding:
1014
- Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where <digest>should be replaced by the message digest and <mgf>by the mask generation function.
1015
- Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING
1016
- - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme
1017
- - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes.
1018
- - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993.
1019
- - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher)
1020
-
1021
-
1022
- **Parameters:**
1023
- - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream)
1024
- - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding).
1025
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include: <li>"AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding" </li> </ul> Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. Also, PKCS5Padding is the only supported Padding. NOPADDING and ISO10126PADDING have been deprecated. Supported Asymmetric transformations include: <li>"RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING" </li> </ul> Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING, OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING.
1026
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1. DSA has a specific initialization that uses three integers to build a DSAParameterSpec (a prime, a sub-prime and a base). To use this algorithm you should use the JCE or another provider to supply a DSAParameterSpec and then supply the Base64 equivalent string as the "salt". Please see the documentation from the provider for additional restrictions.
1027
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data.
1028
-
1029
- **Returns:**
1030
- - the encrypted message encoded as a String using base 64 encoding.
1031
-
1032
- **API Version:**
1033
- :::note
1034
- Available from version 15.5.
1035
- No longer available as of version 16.2.
1036
- Requires Base64-encryption for the salt parameter.
1037
- :::
1038
-
1039
- ---
1040
-
1041
- ### encrypt(String, CertificateRef, String, String, Number) - Variant 3
1042
- - encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
1043
- - : Alternative method to
1044
- [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3), which allows you to
1045
- use a key in the keystore for encryption.
1046
-
1047
-
1048
- Note: Only asymmetric (public/private key pair) algorithms can be used
1049
- with this method, since only those keys can be added to a keystore.
1050
-
1051
-
1052
- For asymmetric algorithms a private/public key pair is required.
1053
- Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx.
1054
- You can assign private keys an extra password in Business Manager. Public keys
1055
- can only be imported as trusted certificates in the format \*.crt, \*.pem,
1056
- \*.der, and \*.cer.
1057
-
1058
-
1059
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
1060
- One of the most popular options is the open source tool OpenSSL.
1061
- OpenSSL has a command-line syntax and is available on major platforms.
1062
-
1063
-
1064
- The following steps are involved in **creating an RSA key pair:**
1065
-
1066
- 1. Generate a public and a non-protected private key ( \*.crt and \*.key ).
1067
-
1068
- ```
1069
- openssl req -x509 -newkey rsa:2048 -keyout nopass.key -out nopass.crt -days 365 -nodes
1070
- ```
1071
-
1072
- 2. Generate a keystore that contains the public and private keys ( \*.p12 ).
1073
-
1074
- ```
1075
- openssl pkcs12 -export -out nopass.p12 -inkey nopass.key -in nopass.crt
1076
- ```
1077
-
1078
-
1079
- To import a private or public key into the Digital keystore, navigate to
1080
- **Administration > Operations > Private Keys and Certificates**
1081
- Use a .p12 file to import a private key and a \*.crt to import a public key.
1082
-
1083
-
1084
- Typical usage:
1085
-
1086
-
1087
- ```
1088
- var plain : String = "some_plain_text";
1089
- var publicKeyRef = new CertificateRef("rsa-certificate-2048");
1090
- var cipher : Cipher = new Cipher();
1091
- var encrypted : String = cipher.encrypt(plain, publicKeyRef, "RSA", null, 0);
1092
- ```
1093
-
1094
-
1095
- **Parameters:**
1096
- - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3))
1097
- - publicKey - A reference to a public key.
1098
- - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3))
1099
- - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3))
1100
- - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3))
1101
-
1102
- **Returns:**
1103
- - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3))
1104
-
1105
- **API Version:**
1106
- :::note
1107
- Available from version 16.2.
1108
- Does not use a default initialization vector.
1109
- :::
1110
-
1111
- ---
1112
-
1113
- ### encrypt(String, String, String, String, Number) - Variant 3
1114
- - encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)
1115
- - : Encrypt the passed message by using the specified key and applying the
1116
- transformations described by the specified parameters.
1117
-
1118
-
1119
- Encryption is the process of converting normal data or plain text to
1120
- something incomprehensible or cipher-text by applying transformations,
1121
- which are the operation (or set of operations) to be performed on given input
1122
- to produce some output. A transformation always includes the name of a
1123
- cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme.
1124
- The supported algorithms are listed in the parameter description below.
1125
-
1126
- The cryptographic algorithms can be partitioned into _symmetric_
1127
- and _asymmetric_ (or public key/private key).
1128
-
1129
-
1130
- **Symmetric** or "secret key" algorithms use the same key to encrypt
1131
- and to decrypt the data. Symmetric algorithms are what most people think
1132
- of as codes: using a well-known algorithm and a secret key to encode information,
1133
- which can be decoded using the same algorithm and the same key. The algorithm
1134
- is not secret, the secrecy is inherent to guarding the key. A significant
1135
- problem with symmetric ciphers is that it is difficult to transfer the keys
1136
- themselves securely. Symmetric algorithms include _password-based_ algorithms.
1137
-
1138
- **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward.
1139
- Please consider switching to it if you are using any other scheme or if using AES with a
1140
- shorter key length. The rest of the symmetric algorithms will be deprecated in the future.**
1141
-
1142
-
1143
- **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key.
1144
- Only the holder of the private key will be able to decrypt.
1145
- The public key and private key together are also called a "key pair".
1146
- Data encrypted with one key can only be decrypted using the other key
1147
- from the pair, and it is not possible to deduce one key from the other.
1148
- This helps to solve the key distribution problem since it is possible to
1149
- publicise one of the keys widely (the "public key") and keep the other
1150
- a closely guarded secret (the "private key"). Many partners can then
1151
- send data encrypted with the public key, but only the holder of the
1152
- corresponding private key can decrypt it.
1153
-
1154
-
1155
- Key pairs for asymmetric ciphers can be generated with an arbitrary tool.
1156
- One of the most popular options is the open source tool OpenSSL.
1157
- OpenSSL has a command-line syntax and is available on major platforms.
1158
-
1159
-
1160
- The following steps are involved in **creating an RSA key pair:**
1161
-
1162
- 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place.
1163
-
1164
- ```
1165
- openssl genrsa -out rsaprivatekey.pem 2048
1166
- ```
1167
-
1168
- 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
1169
-
1170
- ```
1171
- openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout
1172
- ```
1173
-
1174
- 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method.
1175
-
1176
- ```
1177
- openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt
1178
- ```
1179
-
1180
-
1181
-
1182
-
1183
- **Modes**
1184
-
1185
- The following modes of operation are block cipher operations that
1186
- are used with some algorithms.
1187
-
1188
- - "NONE" no mode
1189
- - "CBC" Cipher Block Chaining (defined in FIPS PUB 81)
1190
- - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81)
1191
- - "CTS" CipherText Streaming mode
1192
- - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81)
1193
- - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980.
1194
- - "GCM" Galois/Counter Mode (defined in NIST SP 800-38D)
1195
- - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81)
1196
- - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4)
1197
-
1198
-
1199
-
1200
- **Paddings**
1201
-
1202
- - "NoPadding": No padding.
1203
- - OAEPWith<digest>And<mgf>Padding:
1204
- Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where <digest>should be replaced by the message digest and <mgf>by the mask generation function.
1205
- Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING
1206
- - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme
1207
- - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes.
1208
- - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993.
1209
- - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher)
1210
-
1211
-
1212
- **Parameters:**
1213
- - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream)
1214
- - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding).
1215
- - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include: <li>"AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "GCM","ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding" or "NoPadding" (GCM only) </li> </ul> Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. PKCS5Padding is the only supported Padding for most modes. NOPADDING is only supported for GCM, and ISO10126PADDING has been deprecated. Supported Asymmetric transformations include: <li>"RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING" </li> </ul> Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING, OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING.
1216
- - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits; GCM uses 96 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1. DSA has a specific initialization that uses three integers to build a DSAParameterSpec (a prime, a sub-prime and a base). To use this algorithm you should use the JCE or another provider to supply a DSAParameterSpec and then supply the Base64 equivalent string as the "salt". Please see the documentation from the provider for additional restrictions. Extra algorithm parameters may be configured using this field. Each parameter is given as `<name>=<value>`, and multiple parameters may be separated by a vertical pipe. Unknown parameters will result in an error. Any parameters MUST be given after the salt, even if the salt is empty. For example, RSA does not use a salt, so to set the MGF1 digest algorithm to SHA-256, use `|MGFDigest=SHA-256` Supported Parameters: | Parameter | Type | Description |
1217
- | --- |--- |--- |
1218
- | `MGFDigest` | `String` | Overrides the digest algorithm used by the mask generation function when using OAEP padding. Valid values include SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. The default value is SHA-1. |
1219
- | `TagLength` | `Integer` | Overrides the tag length in bits used for GCM mode. Note if a number is given without a parameter name, it is treated as the tag length for backward compatibility. The default tag length is 128 bits. |
1220
-
1221
- - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data.
1222
-
1223
- **Returns:**
1224
- - the encrypted message encoded as a String using base 64 encoding.
1225
-
1226
- **API Version:**
1227
- :::note
1228
- Available from version 16.2.
1229
- Does not use a default initialization vector.
1230
- :::
1231
-
1232
- ---
1233
-
1234
- <!-- prettier-ignore-end -->