Java 类java.security.KeyRep 实例源码

项目:In-the-Box-Fork    文件:KeyRepTypeTest.java   
/**
 * @tests java.security.KeyRep.Type#values()
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "values",
    args = {}
)
public void testValues() {
    KeyRep.Type[] types = new KeyRep.Type[] { KeyRep.Type.SECRET,
            KeyRep.Type.PUBLIC, KeyRep.Type.PRIVATE };
    try {
        assertTrue(Arrays.equals(types, KeyRep.Type.values()));
    } catch (Exception e) {
        fail("Unexpected exception " + e.getMessage());
    }
}
项目:In-the-Box-Fork    文件:KeyRepTest.java   
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "",
    method = "readResolve",
    args = {}
)
public final void testReadResolve04() throws ObjectStreamException {
    if (keyFactoryAlgorithm.isEmpty()) {
        System.err.println(getName()
                + ": skipped - no KeyFactory algorithms available");
        return;
    } else {
    }
    for (Iterator<String> i = keyFactoryAlgorithm.iterator(); i.hasNext();) {
        KeyRepChild kr = new KeyRepChild(KeyRep.Type.PUBLIC, i.next(),
                "X.509", new byte[] { 1, 2, 3 });
        try {
            kr.readResolve();
            fail("NotSerializableException has not been thrown (no format)");
        } catch (NotSerializableException ok) {

        }
    }
}
项目:In-the-Box-Fork    文件:KeyRepTest.java   
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "",
    method = "readResolve",
    args = {}
)
public final void testReadResolve05() throws ObjectStreamException {
    if (keyFactoryAlgorithm.isEmpty()) {
        System.err.println(getName()
                + ": skipped - no KeyFactory algorithms available");
        return;
    } else {
    }
    for (Iterator<String> i = keyFactoryAlgorithm.iterator(); i.hasNext();) {
        KeyRepChild kr = new KeyRepChild(KeyRep.Type.PRIVATE, i.next(),
                "PKCS#8", new byte[] { 1, 2, 3 });
        try {
            kr.readResolve();
            fail("NotSerializableException has not been thrown (no format)");
        } catch (NotSerializableException ok) {

        }
    }
}
项目:Android_Code_Arbiter    文件:ConstantPasswords.java   
public void bad8a() throws Exception {
    new DESKeySpec(null); // should not be reported
    byte[] key = {1, 2, 3, 4, 5, 6, 7, 8};
    DESKeySpec spec = new DESKeySpec(key);
    KeySpec spec2 = new DESedeKeySpec(key);
    KerberosKey kerberosKey = new KerberosKey(null, key, 0, 0);
    System.out.println(spec.getKey()[0] + kerberosKey.getKeyType());
    new SecretKeySpec(key, "alg");
    new SecretKeySpec(key, 0, 0, "alg");
    new X509EncodedKeySpec(key);
    new PKCS8EncodedKeySpec(key);
    new KeyRep(null, "alg", "format", key);
    new KerberosTicket(null, null, null, key, 0, null, null, null, null, null, null);
    new DSAPublicKeyImpl(key);
}
项目:OpenJSharp    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:OpenJSharp    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:OpenJSharp    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-jdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-jdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-jdk    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-jdk10    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-jdk10    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-jdk10    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk9    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk9    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk9    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u_jdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u_jdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u_jdk    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:lookaside_java-1.8.0-openjdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:lookaside_java-1.8.0-openjdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:lookaside_java-1.8.0-openjdk    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:infobip-open-jdk-8    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:infobip-open-jdk-8    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:infobip-open-jdk-8    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-dev-jdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-dev-jdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk8u-dev-jdk    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:In-the-Box-Fork    文件:KeyRepTest.java   
public KeyRepChild(KeyRep.Type type, String algorithm, String format,
        byte[] encoded) {
    super(type, algorithm, format, encoded);
}
项目:jdk7-jdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk7-jdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:jdk7-jdk    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-source-code-learn    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-source-code-learn    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-source-code-learn    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:OLD-OpenJDK8    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:OLD-OpenJDK8    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:OLD-OpenJDK8    文件:RSAPublicKey.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-jdk7u-jdk    文件:PKCS8Key.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PRIVATE,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}
项目:openjdk-jdk7u-jdk    文件:DSAPublicKeyImpl.java   
protected Object writeReplace() throws java.io.ObjectStreamException {
    return new KeyRep(KeyRep.Type.PUBLIC,
                    getAlgorithm(),
                    getFormat(),
                    getEncoded());
}