<commit_before>/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
 * Copyright (C) 2013 Regents of the University of California.
 * @author: <NAME> <<EMAIL>>
 * @author: <NAME> <<EMAIL>>
 * See COPYING for copyright and distribution information.
 */

#include "simple-visitor.hpp"
#include <ndn-cpp/security/certificate/public-key.hpp>
#include "../der.hpp"
#include "public-key-visitor.hpp"

using namespace std;
using namespace ndn::ptr_lib;

namespace ndn {

namespace der {
  
ndnboost::any 
PublicKeyVisitor::visit(DerSequence& derSeq)
{
  DerNodePtrList& children = derSeq.getChildren();

  SimpleVisitor simpleVisitor;
  shared_ptr<DerSequence> algoSeq = static_cast<shared_ptr<DerSequence> >(children[0]); 
  OID algorithm = ndnboost::any_cast<OID>(algoSeq->getChildren()[0]->accept(simpleVisitor));  
  Blob raw = derSeq.getRaw();   
  return ndnboost::any(shared_ptr<PublicKey>(new PublicKey(algorithm, raw)));    
}

} // der

}<commit_msg>Der encoding: in PublicKeyVisitor, restore the use of dynamic_pointer_cast.<commit_after>/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
 * Copyright (C) 2013 Regents of the University of California.
 * @author: <NAME> <<EMAIL>>
 * @author: <NAME> <<EMAIL>>
 * See COPYING for copyright and distribution information.
 */

#include "simple-visitor.hpp"
#include <ndn-cpp/security/certificate/public-key.hpp>
#include "../der.hpp"
#include "public-key-visitor.hpp"

using namespace std;
using namespace ndn::ptr_lib;

namespace ndn {

namespace der {
  
ndnboost::any 
PublicKeyVisitor::visit(DerSequence& derSeq)
{
  DerNodePtrList& children = derSeq.getChildren();

  SimpleVisitor simpleVisitor;
  shared_ptr<DerSequence> algoSeq = dynamic_pointer_cast<DerSequence>(children[0]); 
  OID algorithm = ndnboost::any_cast<OID>(algoSeq->getChildren()[0]->accept(simpleVisitor));  
  Blob raw = derSeq.getRaw();   
  return ndnboost::any(shared_ptr<PublicKey>(new PublicKey(algorithm, raw)));    
}

} // der

}
{'fraction_non_alphanumeric': 0.15581162324649298, 'fraction_numerical': 0.006012024048096192, 'mean_word_length': 5.107033639143731, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2394690', 'n_tokens_mistral': 665, 'n_tokens_neox': 645, 'n_words': 141}