title: How to connect server by quickfix using private key
body: <p>Im connecting to server using FIX protocol 4.4.
  Previously i used username and password for authentication.</p>
  
  <p>Below is my configuration file</p>
  
  <blockquote>
    <p>[DEFAULT]<br> ConnectionType=initiator<br> HeartBtInt=30<br>
    ReconnectInterval=30<br> ResetOnLogout=Y<br> ResetOnDisconnect=Y<br>
    FileStorePath=/tmp/msgs/<br> FileLogPath=/tmp/msgs/log/<br>
    StartTime=00:00:<br> EndTime=00:00:00<br> UseDataDictionary=N<br>
    SocketConnectHost=193.~.~.~<br> SocketNodelay=Y<br>
    PersistMessages=N<br></p>
    
    <p>[SESSION]<br> BeginString=FIX.4.4<br> SenderCompID=abcdefh<br>
    TargetCompID=abcdefh<br> SocketConnectPort=7000<br>
    SenderSubID=abcdefh<br> Password=abcdefh</p>
  </blockquote>
  
  <p>Now have to connect without using SenderSubID &amp; password, but using private key.
  The keys are given in a pem file.
  I am giving sample of the code below</p>
  
  <blockquote>
    <p>Bag Attributes
        localKeyID: 12 23 34 45 56 AX SC DV FV FB 12 23 34 45 56 AX SC DV FV FB  subject=/CN=abcdefgh
    issuer=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev
    -----BEGIN CERTIFICATE----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890
    -----END CERTIFICATE----- Bag Attributes:  subject=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev
    issuer=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev
    -----BEGIN CERTIFICATE----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890
    -----END CERTIFICATE----- Bag Attributes
        localKeyID: 12 23 34 45 56 AX SC DV FV FB 12 23 34 45 56 AX SC DV FV FB  Key Attributes: 
    -----BEGIN RSA PRIVATE KEY----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890
    -----END RSA PRIVATE KEY-----</p>
  </blockquote>
  
  <p>I don't know how to proceed or what to do with this PEM file<bR>
  I am new to java and FIX protocol</p>
  
  <p>If anyone can explain the solution with java code, that would be very helpful</p>
  
  <p>thanks</p>