protected byte[] engineGetEncoded(){
  AlgorithmIdentifier hashAlgorithm=new AlgorithmIdentifier(DigestFactory.getOID(currentSpec.getDigestAlgorithm()),DERNull.INSTANCE);
  MGF1ParameterSpec mgfSpec=(MGF1ParameterSpec)currentSpec.getMGFParameters();
  AlgorithmIdentifier maskGenAlgorithm=new AlgorithmIdentifier(PKCSObjectIdentifiers.id_mgf1,new AlgorithmIdentifier(DigestFactory.getOID(mgfSpec.getDigestAlgorithm()),DERNull.INSTANCE));
  PSource.PSpecified pSource=(PSource.PSpecified)currentSpec.getPSource();
  AlgorithmIdentifier pSourceAlgorithm=new AlgorithmIdentifier(PKCSObjectIdentifiers.id_pSpecified,new DEROctetString(pSource.getValue()));
  RSAESOAEPparams oaepP=new RSAESOAEPparams(hashAlgorithm,maskGenAlgorithm,pSourceAlgorithm);
  try {
    return oaepP.getEncoded(ASN1Encoding.DER);
  }
 catch (  IOException e) {
    throw new RuntimeException("Error encoding OAEPParameters");
  }
}

protected byte [ ] engineGetEncoded ( ) { AlgorithmIdentifier hashAlgorithm = new AlgorithmIdentifier ( DigestFactory . getOID ( currentSpec . getDigestAlgorithm ( ) ) , DERNull . INSTANCE ) ; MGF1ParameterSpec mgfSpec = ( MGF1ParameterSpec ) currentSpec . getMGFParameters ( ) ; AlgorithmIdentifier maskGenAlgorithm = new AlgorithmIdentifier ( PKCSObjectIdentifiers . id_mgf1 , new AlgorithmIdentifier ( DigestFactory . getOID ( mgfSpec . getDigestAlgorithm ( ) ) , DERNull . INSTANCE ) ) ; PSource . PSpecified pSource = ( PSource . PSpecified ) currentSpec . getPSource ( ) ; AlgorithmIdentifier pSourceAlgorithm = new AlgorithmIdentifier ( PKCSObjectIdentifiers . id_pSpecified , new DEROctetString ( pSource . getValue ( ) ) ) ; RSAESOAEPparams oaepP = new RSAESOAEPparams ( hashAlgorithm , maskGenAlgorithm , pSourceAlgorithm ) ; try { return oaepP . getEncoded ( ASN1Encoding . DER ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error encoding OAEPParameters" ) ; } }
return the pkcs # 1 asn . 1 structure rsaes - oaep - params .
