anchor.diff:                                                               Entity :: term() .
   
   pem_entry_encode('SubjectPublicKeyInfo', Entity=#'RSAPublicKey'{}) ->
  -    Der = der_encode('RSAPublicKey', Entity),
  -    Spki = {'SubjectPublicKeyInfo',
  -            {'AlgorithmIdentifier', ?'rsaEncryption', ?DER_NULL}, Der},
  +    KeyDer = der_encode('RSAPublicKey', Entity),
  +    Spki = subject_public_key_info(#'AlgorithmIdentifier'{algorithm = ?'rsaEncryption',
  +                                                          parameters =?DER_NULL}, KeyDer),
       pem_entry_encode('SubjectPublicKeyInfo', Spki);
   pem_entry_encode('SubjectPublicKeyInfo',
                    {DsaInt, Params=#'Dss-Parms'{}}) when is_integer(DsaInt) ->
       KeyDer = der_encode('DSAPublicKey', DsaInt),
       ParamDer = der_encode('DSAParams', {params, Params}),
  -    Spki = {'SubjectPublicKeyInfo',
  -            {'AlgorithmIdentifier', ?'id-dsa', ParamDer}, KeyDer},
  +    Spki = subject_public_key_info(#'AlgorithmIdentifier'{algorithm =?'id-dsa',
  +                                                          parameters = ParamDer},
  +                                   KeyDer),
       pem_entry_encode('SubjectPublicKeyInfo', Spki);
   pem_entry_encode('SubjectPublicKeyInfo',
   		 {#'ECPoint'{point = Key}, {namedCurve, ?'id-Ed25519' = ID}}) when is_binary(Key)->
  -    Spki = {'SubjectPublicKeyInfo',
  -	    {'AlgorithmIdentifier', ID, asn1_NOVALUE},
  -	    Key},
  +    Spki = subject_public_key_info(#'AlgorithmIdentifier'{algorithm = ID}, Key),
       pem_entry_encode('SubjectPublicKeyInfo', Spki);
   pem_entry_encode('SubjectPublicKeyInfo',
   		 {#'ECPoint'{point = Key}, {namedCurve, ?'id-Ed448' = ID}}) when is_binary(Key)->
  -    Spki = {'SubjectPublicKeyInfo',
  -	    {'AlgorithmIdentifier', ID , asn1_NOVALUE},
  -	    Key},
  +    Spki = subject_public_key_info(#'AlgorithmIdentifier'{algorithm = ID}, Key),
       pem_entry_encode('SubjectPublicKeyInfo', Spki);
   pem_entry_encode('SubjectPublicKeyInfo',
   		 {#'ECPoint'{point = Key}, ECParam}) when is_binary(Key)->
       Params = der_encode('EcpkParameters',ECParam),
  -    Spki = {'SubjectPublicKeyInfo',
  -	    {'AlgorithmIdentifier', ?'id-ecPublicKey', Params},
  -	    Key},
  +    Spki = subject_public_key_info(#'AlgorithmIdentifier'{algorithm =?'id-ecPublicKey',
  +                                                          parameters = Params},
  +                                   Key),
       pem_entry_encode('SubjectPublicKeyInfo', Spki);
   pem_entry_encode(Asn1Type, Entity)  when is_atom(Asn1Type) ->
       Der = der_encode(Asn1Type, Entity),
  
positive.code:     Key = der_decode('RSAPrivateKey', PrivKey),
      Params = der_decode('RSASSA-PSS-params', Parameters),
      {Key, Params};
  der_priv_key_decode({'PrivateKeyInfo', v1,
  	{'PrivateKeyInfo_privateKeyAlgorithm', ?'id-dsa', {asn1_OPENTYPE, Parameters}}, PrivKey, _}) ->
  	{params, #'Dss-Parms'{p=P, q=Q, g=G}} = der_decode('DSAParams', Parameters),
  	X = der_decode('Prime-p', PrivKey),
  	#'DSAPrivateKey'{p=P, q=Q, g=G, x=X};
  der_priv_key_decode(PKCS8Key) ->
  	PKCS8Key.
  
  %%--------------------------------------------------------------------
  -spec der_encode(Asn1Type, Entity) -> Der when Asn1Type :: asn1_type(),
  
negative.code: ocsp_responses(OCSPResponseDer, ResponderCerts, Nonce) ->
      pubkey_ocsp:verify_ocsp_response(OCSPResponseDer, 
                                       ResponderCerts, Nonce).
  
  subject_public_key_info(Alg, PubKey) ->
      #'OTPSubjectPublicKeyInfo'{algorithm = Alg, subjectPublicKey = PubKey}.
  