You&#x27;re almost certainly not going to get direct memory access or read keys off storage media like you might with a general-purpose computer. Attempts to physically get inside the chip to do so will destroy the keys. You have to communicate with the software running onboard.<p>But the software running onboard is, well, just software. It&#x27;s common for applets to want a PIN before performing signing or decryption operations, and to lock out further attempts after N bad PIN entries. Yubikeys were vulnerable for a while to a logical flaw in the applet that let you trick it into signing without the PIN. Presumably applets can have buffer overflows and logical flaws just like everyone else; it&#x27;s not inconceivable that you could get remote code execution inside the smart card by talking to it the right way. If implemented correctly, you still shouldn&#x27;t be able to get the key this way, but you can use it. Also, while there exist readers with onboard PIN keypads, most people type their pins into desktop software that you could phish or keystroke log with remote code execution on the client PC, then have remote use of the card as long as it&#x27;s connected to a compromised machine.<p>There&#x27;s also generally a layer (or two) of administrative PIN&#x2F;PUK codes so organizational administrators can reset forgotten user PINs. This is sort of a problem for the military when people in remote postings lock themselves out of their computers are there are no sufficiently privileged IT guys around. Some organizations can do this remotely, which is (probably) cryptographically secure but vulnerable to social engineering if you can steal a card and convince remote support to give you a PIN reset code. There&#x27;s also another code that&#x27;s necessary to replace applets. All of these are presumably vulnerable to being left at their factory defaults, being leaked by a careless administrator, etc. and not easy to rotate if compromised.<p>HID iClass (smart card-ish proximity physical access control) credentials are supposed to be impossible to clone without a cryptographic key, for example, except the same key is embedded in every HID reader. You can rip one off a wall, JTAG it, get the key, and sign arbitrary cards for any building that hasn&#x27;t bothered to generate a facility-specific key (and almost no one has).<p>In a stored value card application, you probably can&#x27;t get inside the card and flip a bit to give yourself $1,000,000. But there&#x27;s a much better chance you can figure out the protocol spoken by vending machines and impersonate one. Security through obscurity is common here, and if cryptography is used the private keys in the vending machines may well be sitting in RAM in Windows XP on a subway platform, or crypto primitives may have been chosen incorrectly, or keys may be available by social-engineering the manufacturer.<p>Smart cards aren&#x27;t a panacea. As some CIO-focused trade press mentions, most real-world breaches don&#x27;t involve stealing authentication credentials. Having super-secret SSH keys doesn&#x27;t help you if I can get a shell through PHP. But it is a hell of a lot easier for an attacker to get your SSH private key from ~&#x2F;.ssh&#x2F;id_rsa than from your smart card - at worst the smart card would let him <i>use</i> it.<p>BTW, you <i>can</i> generate the keypair on a computer (preferably an air-gapped one) and load it onto a smart card. This would let you have backups. But most applications are for authentication; there is no need to have a backup because administrators can simply associate a new card with the account. Server-side HSMs have different properties.&#x27;<p>(I am not a security expert, just taken an interest in this recently.)