Scott James Remnant

I can dance if I want to

Read this first

Swift: Storing key pairs in the keyring

In my last blog post I described how to generate public/private key pairs in Swift and use them to encrypt and decrypt text. But that’s not entirely useful in its own unless you have a place to store the pairs, such as the iOS keychain.

Eagle-eyed readers may have also noticed that I skipped one important detail when discussing generating keys:

var publicKeyPtr, privateKeyPtr: Unmanaged<SecKey>? result = SecKeyGeneratePair(parameters, &publicKeyPtr, &privateKeyPtr) 

I never specified the parameters dictionary anywhere.

Unfortunately this involves wading into the murkier parts of the compatibility between Swift, Foundation and Core Foundation: the compatibility between the different array and dictionary types, and the different type strictness required for protocol conformance.

Consider the basic dictionary that we would pass for a 2048-bit RSA key:

//  Type...

Continue reading →

Swift: Generating keys, and Encrypting and Decrypting text

Swift is still a very new programming language and as such there hasn’t been time yet for a large body of lore about the correct way to do things to be built up on the Internet. Apple have done a good job on the initial documentation, but the deep technical understanding of things, like the built-in protocols the language uses, hasn’t been built yet.

For a project I needed to be able to generate a public/private key pair, and then use those to encrypt and decrypt plain text. This requires a set of C APIs defined in Certificate, Key, and Trust Services Reference.

When I looked for examples on how to use these in Swift, I found some pretty terrible code out there. To me that’s always a warning sign; if code looks difficult and unwieldy to use, you’re probably doing it wrong. Of course, being a new language, it could be that Apple is doing it wrong, but in general the Swift language and...

Continue reading →

The Slacker List

It’s been six weeks since Apple launched the iPhone 6 and iPhone 6 Plus, and over four months since WWDC when Apple revealed the changes to the AutoLayout APIs to enable apps to adapt to the larger screen sizes of the upcoming phones.

You’d think that this would be plenty of time for app developers to grab the new Xcode, test their app with the larger sizes, fix any resulting problems, and release an update.

I wonder how much of this delay is fear of the slow adoption of iOS 8, with 53% of devices running an older version as of October 5th, there could be fear from developers that supporting the newer AutoLayout APIs would put a significant portion of their userbase at risk.

Perhaps that’s why Apple are forcing all newly submitted apps to be built with the iOS 8 SDK.

The rest of this post constitutes the list of apps installed on my iPhone that are still running in scaled mode.


Continue reading →

Happy 10th Birthday, Ubuntu

20th October 2004, ten years ago today, Ubuntu 4.10 (Warty Warthog) was released. While the user community celebrates the decade anniversary today, for me and those of us who worked on it, it was the result of almost eight months of work.


My story, in common with the majority of the original group, really begins with the Debian Project. I had taken a year off full-time work and had been concentrating on involving myself more with the Linux community in general, and Debian in particular.

By early 2004, the then Debian Project Leader, Martin Michlmayr had asked me to step in and take over the maintenance of Dpkg, the central package management software of the operating system. I was invited to attend the Open Source World Conference in Málaga, Spain and meet with other developers there, in particular Colin Watson and Tollef Fog Heen, to figure out the details of how we’d go about that....

Continue reading →

A road trip with Apple CarPlay

With almost impeccable timing, the firmware upgrade to support Apple’s CarPlay was released for my car’s heads-up unit the day before I was set to go on a road trip from San Francisco to Los Angeles and drive around that unfamiliar city for the weekend. This seemed like the perfect opportunity to put it through its paces.


The heads-up unit in question is the Pioneer AVIC-8000NEX, their flagship unit with a 7" Capacitive Touchscreen display. This comes with its own built-in navigation software, iPod controls for music either by Lightning cable or Bluetooth and even support for apps via their AppRadio technology.

Not only is it the best of the aftermarket units for running CarPlay, it also provides a pretty decent unit in its own right to compare functionality and behavior to.


It’s arguable whether the number one function of a car’s heads-up unit these days is music, or...

Continue reading →

The missing iOS 8 NFC API

There have been a bunch of comments and criticisms flying around that iOS 8 is missing any kind of API or SDK for developing applications to take advantage of the NFC chip in the iPhone 6 and iPhone 6 Plus. One article at least even went as far as to describe the decision not to provide one as “stupid”.

I disagree, not providing APIs in the first iteration of hardware has been pretty much an Apple standard operating procedure for a long while now, and I think it makes perfect sense in this case as well.

The most typical thing a software developer is going to do with an NFC API is write an app that reads NFC tags. The Android store is pretty much full of these; you download an app, you tap your Clipper Card on it, and it tells you a bunch of meaningless gibberish.

This isn’t very useful, because it turns out that the more interesting cases for NFC are when the phone is acting as a tag....

Continue reading →

Songs of Innocence

The most surprising thing about Apple’s move to preload the new U2 album onto iPhones isn’t that they did it, but that people are surprised that users are angry about it.

For example John Gruber declared “Nailed It” in response to someone describing “removing a free album” as a “first world problem”.

Apple themselves said it in the very keynote they announced this. These iPhones, iPads and iPods are incredibly personal devices, to which users create a much more intimate bond than they do to pretty much any other device.

The WATCH is only going to be even more personal than that.

Apple have been preloading apps onto our personal devices for a while now, whether we like them or not, with no way to delete them. It wasn’t a surprising move for them to start preloading music either.

But they, and nobody else, should be surprised that people see this as an invasion of their personal space.

Continue reading →


Apple are expected to announce some form of innovative new payment system tomorrow morning, but I think another company already has the jump on them for that: Disney.

If you’ve stayed in their Walt Disney World resort recently you’ll have encountered the Disney Magic Band, and the whole MyDisney+ experience.

Before you even get to the resort you receive your Magic Band, that you wear on your wrist the entire time you’re there. You get to pick your color, you get to buy cute ornaments and covers for it, and the whole thing is pretty reasonably ergonomically designed.

And inside is an NFC tag and a Bluetooth LE radio.

The band is your hotel room key, you simply hold your wrist up to the door lock and your room opens and allows you inside.

It’s your ticket into the park, combined with a fingerprint reader to ensure that the same person uses the same band each time. (Something they’ve...

Continue reading →

Subscribe to Scott James Remnant

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.