Categories
Mastering Development

Digital signatures invalid when I use the iTextSharp

This is my Form – Following are the code – private void btnSign_Click(object sender, EventArgs e) { string sbase64 = richTextBox2.Text; byte[] bytes = System.Convert.FromBase64String(sbase64); PdfReader reader = new PdfReader("F:\\test1.pdf"); FileStream os = new FileStream("F:\\output.pdf", FileMode.Create); IExternalSignatureContainer external1 = new MyExternalSignatureContainer(bytes); MakeSignature.SignDeferred(reader, "Signature1", os, external1); reader.Close(); os.Close(); } private class MyExternalSignatureContainer : IExternalSignatureContainer { protected […]

Categories
Mastering Development

Usage of recoil in custom NPM component

I’m trying to use recoil in a custom npm component so that i can publish and use it in an application but upon usage getting error as below: Invalid hook call. Hooks can only be called inside of the body of a function component… > const useStoreRef = () => useContext(AppContext); I’m using following rollupjs […]

Categories
Mastering Development

Get PDF content for signing and then sign at a later time

I’m following the following post: iTextSharp – How to get PDF content for signing and then sign at a later time as a base to get the data from the PDF document, create a temporary file with a blank signature and then return the hash of that temporary file. The hash is sent to the […]

Categories
Development System & Network

freepbx/asterisk “All circuits are busy” new install

This has been an issue with every install I have ever put together and could google the answer quickly. However, I haven’t built a freepbx for over 2 years and cant recall how to resolve it, and can not find the answer. On all outgoing calls, I get a voice prompt “All circuits are busy” […]

Categories
Development

Invalid signature – detached iTextSharp PDF signing with RSA PKCS#1 v1.5 signature from smart card using PKCS#11

My goal is to implement a PDF signing process in which the server (.NET Core service) provides the hash to be signed to the client (Angular + Electron NodeJS). The client then signs the given hash using a private key obtained from a smart card through a PKCS#11 interface. The signature is then sent back […]

Categories
CMS Development Wordpress

Unable to access theme activation page – permission issue

I am constantly getting the “Sorry, you are not allowed to access this page” when I click the submit_button from the theme activation. But if I go to the wp-admin page directly in the address bar I can see the dashboard. This is causing issues as part of the activation is to create pages, and […]

Categories
CMS Development Wordpress

Multisite custom user roles not working correctly

I am trying to create complete custom user roles for my multisite environment, but for some reason it doesn’t seem to work. I can’t seem to figure out why it won’t register correctly what permission it has or does not have. I have followed the codex and remove_role then add_role but that updates the capabilities, […]

Categories
Development

Unable to fetch users and groups using node js activedirectory

I am using node js activedirectory module for AD authentication and fetching users & groups. Able to authenticate successfully but unable to get users & groups using .findUser(), .findUsers(), .findGroups() methods. I’ve added few users and a group using ADSI editor in windows 10. Any clue what could be going wrong? Screenshot of ADSI editor […]

Categories
Development

pyspark truncate table without overwrite

I need to truncate a table before inserting new data. I have the following code to insert: df.write.jdbc(dbUrl, self._loadDb, “append”, self._props[‘dbProps’]) Which works great, except.. i want an empty database. I know about setting the mode to overwrite and adding .option(‘truncate’, True) but .. this is not what i want. In another way; how can […]

Categories
Development Ruby

Ruby encoding ASCII_8BIT and extended ASCII

About ASCII_8BIT Encoding::ASCII_8BIT is a special encoding that is usually used for a byte string, not a character string. But as the name insists, its characters in the range of ASCII are considered as ASCII characters. This is useful when you use ASCII-8BIT characters with other ASCII compatible characters. Source: ruby-doc.org/core-2.6.4 Context I want to […]