title: Loading a certificate as embedded resource in an assembly
body: <p>I have added a PFX file as an embedded resource in an assembly to use the certificate to sign a JWT token. I load the pfx as stream and read all the bytes and using X509Certificate2 to load the private key</p>
  
  <blockquote>
    <p>public X509Certificate2(byte[] rawData, string password)</p>
  </blockquote>
  
  <p>Works fine on dev machine in both Debug/Release, but when deployed to azure apps ervice or a build machine i am seeing "Bad data" error. </p>
  
  <p>Any help greatly appreciated.
  Thanks</p>