Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:23:55+00:00 2026-05-30T22:23:55+00:00

This is follow up on Mono xbuild error CS1548 – key file has incorrect

  • 0

This is follow up on Mono xbuild error CS1548 – key file has incorrect format

Hi, I have an application that is written in C# using VS2008. At present we are porting this app to Mac using Mono.

I have tried to extract the key from the pfx file.
First I used

`sn -pc key.pfx key.snk`

this gave me an error of

'Failed to extract public key for key pair -- Keyset does not exist'.

I then used

`sn -p key.pfx key.snk`

this created the snk file that I wanted.
I then in mono selected the project Option > Assembly Signing
When built the error

'key.snk is missing private key needed for signing'.

I think I understand that if I make a new snk key that I can have both private and public keys in it. It just that because of Legacy issues we would really like to be able to use the original pfx key values.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:23:56+00:00Added an answer on May 30, 2026 at 10:23 pm

    Big thanks Poupou for coming up with the answer I have just added the code to the little program I made to get my snk.

    using System.IO;
    using System.Security.Cryptography;
    using System.Security.Cryptography.X509Certificates;
    
    namespace PfxSnk
    {
        internal class Program
        {
            private static void Main(string[] args)
            {
                X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
                RSACryptoServiceProvider provider = (RSACryptoServiceProvider)cert.PrivateKey;
    
                byte[] array = provider.ExportCspBlob(!provider.PublicOnly);
    
                using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write))
                {
                    fs.Write(array, 0, array.Length);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of python methods that follow this pattern: def delete_session(guid): conn
Well lets say I have this follow code in my htaccess file, Options +FollowSymlinks
I follow this pattern to organize my js application. As that example says our
Trying to follow this example. (Section String sorting...) Is there anything obvious that would
There are a few windows service projects in our codebase that follow this model,
Update: Tried November CTP release. Same error message. Forgot to mention that this server
I am programming under Delphi Prism for Mono. I keep getting this error, Cannot
This is follow on from this question: Format List<T> to concatenate fields . The
This is follow-up on my question: error in java basic test program This is
I follow this tutorial for install omniauth in devise+mongoid: https://github.com/fertapric/rails3-mongoid-devise-omniauth/wiki/OmniAuth-Installation-Tutorial I have devise 1.4.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.