Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -183,7 +182,7 @@ public List<OpenPGPUserId> getValidUserIds(Date evaluationTime)
*/
public Map<KeyIdentifier, OpenPGPComponentKey> getPublicKeys()
{
Map<KeyIdentifier, OpenPGPComponentKey> keys = new HashMap<KeyIdentifier, OpenPGPComponentKey>();
Map<KeyIdentifier, OpenPGPComponentKey> keys = new LinkedHashMap<KeyIdentifier, OpenPGPComponentKey>();
keys.put(primaryKey.getKeyIdentifier(), primaryKey);
keys.putAll(subkeys);
return keys;
Expand Down
6 changes: 3 additions & 3 deletions pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -74,7 +74,7 @@ public OpenPGPKey(PGPSecretKeyRing keyRing, OpenPGPImplementation implementation
super(keyRing, implementation, policy);

// Process and map secret keys
this.secretKeys = new HashMap<KeyIdentifier, OpenPGPSecretKey>();
this.secretKeys = new LinkedHashMap<KeyIdentifier, OpenPGPSecretKey>();
for (Iterator it = getKeys().iterator(); it.hasNext(); )
{
OpenPGPComponentKey key = (OpenPGPComponentKey)it.next();
Expand Down Expand Up @@ -147,7 +147,7 @@ public OpenPGPSecretKey getPrimarySecretKey()
*/
public Map<KeyIdentifier, OpenPGPSecretKey> getSecretKeys()
{
return new HashMap<KeyIdentifier, OpenPGPSecretKey>(secretKeys);
return new LinkedHashMap<KeyIdentifier, OpenPGPSecretKey>(secretKeys);
}

/**
Expand Down