/******************************************************************************
 * Copyright (c) 2000-2021 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Szabados, Kristof *
 ******************************************************************************/
module BER_EncDec_79 {

import from BER_EncDecA_79 all;

external function enc_DER_PDU(in BERPDU pdu) return octetstring with { extension "prototype(convert) encode(BER:BER_ENCODE_DER)" }
external function enc_CER_PDU(in BERPDU pdu) return octetstring with { extension "prototype(convert) encode(BER:BER_ENCODE_CER)" }
external function dec_BER_PDU(in octetstring stream) return BERPDU with { extension "prototype(convert) decode(BER)" }

const BERPDU myValue := {b := true }


type component TempComp {}
testcase TC() runs on TempComp {

if ((enc_DER_PDU(myValue) == 'A005A3030101FF'O)and(enc_CER_PDU(myValue) == 'A080A3800101FF00000000'O)) {setverdict(pass);} else {setverdict(fail);}
if (dec_BER_PDU('A005A3030101FF'O) == myValue){setverdict(pass);} else {setverdict(fail);}
if (dec_BER_PDU('A080A3800101FF00000000'O) == myValue){setverdict(pass);} else {setverdict(fail);}

} 

control { 
execute (TC()) 
}
}
